2021年1月19日星期二

Docker run -v : Unable to mount a bind volume : "invalid volume specification"

I'm quite new to Docker. I'm running on Windows 10 Enterprise and am trying to containerize an existing app that runs on windows (so it's a Windows container). I don't know if this matters but the container is rather large (8 GB).

I need to share a config file (that lives on the host) with the container that the app will use when starting. I was thinking that a bind volume was simplest.

Problem: On running the image I get docker: Error response from daemon: invalid volume specification: '<source path>:<target path>'

Container was built with this command:
docker build -t my_image .

Here is the Dockerfile:

FROM mcr.microsoft.com/dotnet/framework/runtime:4.8  WORKDIR /app  COPY . .  ENTRYPOINT .\application.exe ..\Resources  

Here is what I've tried
docker run -it -v c:/Users/my_user:/app my_image

  • I've tried every combination of C:/, C:\, C:\\, /c/, //c/, \c\, \\c\, etc.
  • I've tried multiple combinations of /app, //app, \app, \app, C:\app, etc.
  • I've also tried with and without :rw appended to the end
  • I've tried the ```--mount``` syntax which consistently outputs: docker: Error response from daemon: invalid mount config for type "bind": invalid mount path: '/app'. (tried a bunch of variations of /app here too)

  • I've tried every possible combination (except the right one). Please help!

    https://stackoverflow.com/questions/65802105/docker-run-v-unable-to-mount-a-bind-volume-invalid-volume-specification January 20, 2021 at 10:05AM

    没有评论:

    发表评论