Docker: Mount volume from Windows host

倖福魔咒の 提交于 2019-12-12 03:34:41

问题


I use 1.12 version of Docker on Windows, since I can't use the Hyper-V feature with the newer "native" version - so I have my quickstart terminal and communicate to docker host via the invisible underlying virtual box.

Now I have the problem, that I need to mount a local folder to a container, which worked successfully from within the docker-machine by adding

--volume="`pwd`:/root/data"

to the docker run command, but it does not when I launch the same command from my Windows quickstart terminal (even though pwd command works correctly in the terminal).

I tried to find the Windows specific settings for the directory and tested several combinations of format, but no luck. Can anyone help me out on how to correctly specify a Windows folder (e.g. C:\Users\alexander.ruehl) for the volume parameter?


回答1:


You can use relative path for your volume : --volume="./mydata:/root/data"

Also make sure that you have given the permission for read/write to Docker.



来源:https://stackoverflow.com/questions/41996205/docker-mount-volume-from-windows-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!