Docker Mount Project error response from daemon on

2019-06-24 06:01发布

I am new in using Docker and I want to mount my project in a container to run it on a Virtual Host. First of all I installed the Docker Toolbox that works for Windows 10. I am using the Docker QuickStart Terminal as my CLI to work with. I tried to pull an image that I will use for my project and it was successfull.

Unfortunately when I try to mount my project I get this error.

C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /var/www/app/. See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

And this is the command to mount the project on that specific image to create a container that I will run on.

docker run -d --name=cbpass_container -v C:\Users\me\Documents\cbpass\server:/var/www/app/ -P -p 5432:5432 -t -i
image/someimagename:dev

Is there any problem with my command? Appreciate if someone can help. Thanks in advance.

3条回答
相关推荐>>
2楼-- · 2019-06-24 06:28

In docker for windows, you have options/settings to add a directory for sharing. I think that handles what I am going to describe.

In docker toolbox, we have VirtualBox running between our own machine and container. So when you are going to share a folder, you have to share it with Virtual Machine first, then you can share with container.

In VirtualBox, find your docker-machine (probably default), then in settings you can find Shared Folders. After adding your folder there, please pick a wise name for your folder. Then you will see that when you ssh your container in toolbox, you will see there is a folder in path "/your-folder-name". You can then use -v argument with that path.

查看更多
你好瞎i
3楼-- · 2019-06-24 06:34

Have you enabled the shared drives?

查看更多
劳资没心,怎么记你
4楼-- · 2019-06-24 06:37

try changing host path to : /C/Users/public/xxx

I test with OK with the following cmd (Windows 7):

docker run -p xxx:xxx --network=host -it -v /c/Users/Public/log:/var/log --rm --privileged registry.xxxxxx.xxxx.xxx

May this help you :)

查看更多
登录 后发表回答