-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unable to mount host volume to externalize data using Windows #846
Comments
I have the same problem. I guess the root directory But still have no idea how to fix it. |
The current work-around seems to be to create a docker volume, and then share that between docker and your native OS. Here is where I found that solution: Having said that, I'd really like to just be able to -v /c/path:/someplace |
That's ture. I can also use It seems it is a bug of Git Bash. Does anyone tried boot2docker under cygwin? Is that possible to mount the disk? Git Bash will translate all |
I was pointed out to a work around in issue moby/moby#12590 using a double slash seems to work. I checked it locally and it works.
Using the double slash the host volume is mounted correctly |
@mpas Nice! it also works with |
@imwithye $pwd: Even better! Thanks for sharing, having to use a static name was another nuisance in the syntax. |
This does not seem to work for an interactive session (using |
|
docker run -p 88:80 -it -v //g/test.conf:/etc/nginx/conf.d/test.conf --name nginxtest nginx |
@sunhaolin note that by default, only the |
Hello @thaJeztah I'm not sure I understand what you mean. So, only subdirectories of docker run -v //h:/data -w /data --rm -it node bash I can only see directories under the path from where I have launched that command, and no files inside it. This means that, inside the docker container I can navigate to Regards |
@danielo515 correct; you need to understand that the Because you sometimes want to mount files from the Windows host inside a container, boot2docker uses a "trick"; the It's a bit complicated, so, hope it's clear what's happening 😄 |
Hello @thaJeztah It sounds a bit twisted, but hey, every workaround is. From your description I understand that theorically I could use virtual box addons to make another folder visible to the virtual machine and be able to mount them. But I'm not sure if that will work with the |
@danielo515 yes, you can add additional paths, but that has to be done manually, some instructions can be found here; https://github.com/boot2docker/boot2docker/#virtualbox-guest-additions Also, you may be interested in the Docker for Windows beta; https://beta.docker.com |
https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/71 |
@thaJeztah thanks for explanation. Interesting - while running Windows 10, it appears that mounting a directory this way actually creates a copy of the directory and contents. After running a container, if I change the contents of a file or directory on my local machine it is not reflected in the container. Is this correct, expected behavior? |
If, for some reason, you're mounting a |
I am trying to mount a host volume to a Docker container for MongoDB. The Dockerfile contains the following.
--> The docker image has a name called mongo.
But when i try to start the image and mount a local Windows folder using:
I get an error message saying:
I checked with
boot2docker ssh
if the path is accessible and it seems ok.docker@boot2docker:/c/Users/310145787/Desktop/mongo
Using Boot2Docker 1.6.0
The text was updated successfully, but these errors were encountered: