-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic volume mount fails with windows docker client against boot2docker #12751
Comments
+1 |
/ping @ahmetalpbalkan (haven't tested this myself yet) |
@skaegi @sirRagnar This is duplicate of #12590. It's happening due to msys, it converts unix paths to windows paths before passing them to docker.exe. In this case, that's not a docker bug. (it's not a msys bug either, it's by design.) See my comments in #12590 to run it correctly, or use cmd.exe or powershell to not to have this problem. |
@ahmetalpbalkan do you think we should add something to the docs explaining this? I can imagine more people will run into this. I'm going to close this issue, because of the reasons mentioned above #12751 (comment) Thanks for reporting @skaegi, it's appreciated |
I tried the path workarounds with limited luck but indeed this is MSYS path conversion in action -- a few more details here Double slash works if desperate -- e.g. these work
but for now probably best to use either powershell or boot2docker ssh |
The double slash at the beginning works in most cases. But there's one in particular that won't work
Problem bit is I've tried playing with the posix path conversion rules that @skaegi linked to, but couldn't find a combo that would work. Any suggestions? |
When using boot2docker through git bash, the is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue moby#12751](moby#12751) but needs more visibility in the docs. Signed-off-by: Matthieu Larcher <github@ringabell.org>
When using boot2docker through git bash, there is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue moby#12751](moby#12751) but needs more visibility in the docs. Signed-off-by: Matthieu Larcher <github@ringabell.org>
When using boot2docker through git bash, there is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue moby#12751](moby#12751) but needs more visibility in the docs. Signed-off-by: Matthieu Larcher <github@ringabell.org> (cherry picked from commit 33be2c5)
When using boot2docker through git bash, there is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue moby#12751](moby#12751) but needs more visibility in the docs. Signed-off-by: Matthieu Larcher <github@ringabell.org>
When using boot2docker through git bash, there is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue moby#12751](moby#12751) but needs more visibility in the docs. Signed-off-by: Matthieu Larcher <github@ringabell.org>
docker run -d --name redis-server -p 6379:6379 -v /h/redis:/var/lib/redis anapsix/redis /h/redis = H://redis |
Recently I tried mounting using Docker Run command in Windows, still it doesn't work. Can anyone help me here?
|
By default, only the "c:\users" directory is shared with the VirtualBox VM, so anything outside of that can't be used as a volume, unless you configured VirtualBox to share other directories
|
I am having the problem on Windows 2016 Server TP4, without using boot2docker, since containers are supported there natively.
but it fails with an error:
Detailed issue report: http://superuser.com/questions/1051520/docker-windows-container-how-to-mount-a-host-folder-as-data-volume-on-windows |
@mathiasconradt I think the "container" path for Windows containers needs to be a regular Windows-style path (forward slashes are accepted though), so
( |
@thaJeztah Thanks, you are right. I tried C: before but had left the trailing / in the front, which does not work. Not it's working, thanks a lot! @thaJeztah Note that in this case, the docker documentation should be corrected, because on https://docs.docker.com/engine/userguide/containers/dockervolumes/#mount-a-host-directory-as-a-data-volume it still shows the path pattern incorrectly:
|
You can also set an environmental variable to disable path conversion, but note this was ONLY added in Git for Windows.
It's still a very hacky fix. http://stackoverflow.com/a/34386471/1160528 Just like in actual Linux, G4W's shell (called mintty) supports After that, relaunch your bash and it'll warn you that login scripts are missing, but have been automatically added - and never worry about this again (until it's properly dealt with, at least). Personally I found that automatic path conversion caused nothing but problems, which is why I've blanket disabled it (in gitbash/mintty). If you find yourself needing it occasionally, just drop a A better way to convert paths is to do it explicitly, with |
Error: Invalid volume specification Description:
i tried everything from // to ' but nothing worked for me. at the end i tried this workaround to make it work.
So when you don't specify volume it use the same name as of your source directory and it worked. now i can see my folder mounted under /files on my docker container. :-) |
@adeelahmadch I found Docker-compose has an option
|
@mirasrael thanks, this worked for me! |
docker run -itd -p 7776:7776 -v C:/temp/test:C:/testdir --name Test inet-test This worked for me (y) Going into Container : docker exec -it powershell (for windows containers) |
I couldn't get I'm just trying to run a basic tutorial volume thing that gives the above error response from daemon, invalid bind spec or not a valid repository/tag... Maybe someone can tell me how paths are supposed to be typed in via powershell. Like this line below, what am I typing wrong? How would I type that path? Thanks.
|
Or when I try to create a container like this,
So I'm not sure what I'm doing wrong to get this to work. I've already got an express app installed and I'm in that directory, that's where the PWD comes in and seems to throw no error. Only the Just to update, Just trying to get something to work but the above tells me |
…12751, `MSYS_NO_PATHCONV=1`).
I solved it! Add a volume: docker run -d -v my-named-volume:C:\MyNamedVolume testimage:latest docker run -d -v C:\Temp\123:C:\My\Shared\Dir testimage:latest |
@DanJ210 did you ever figure out why you were getting that error due to the working directory? I've got the same issue and I can't figure out why it won't work. |
I'm just trying to do the most basic volume mount. Something like....
$ docker run -it -v /myvol debian:jessie /bin/bash FATA[0000] Error response from daemon: cannot bind mount volume: C volume paths must be absolute.
Using docker 1.6
Windows Client / Boot2Docker Host
Git Bash with eval ${boot2docker shellinit}
Using a host directory I get...
I expected everything to run relative to the host. e.g. I expected the same behavior as if I was running these commands with
boot2docker ssh
. Am I missing something here?The text was updated successfully, but these errors were encountered: