-
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
Broken volume mounting under Windows #18756
Comments
I have the same issues. Not using paths with spaces. Windows 10. This same image works perfectly under MacOS/X (where it was created)
This is the container running "correctly" (and I'm not passing in the volume information)
Works fine on MacOS - but under Windows 10 I get
Note the rather weird extraneous "C:\Program Files\Git" - which confuses me. So, how about using that winpty command for docker to see what happens
Changing to not use $(pwd) and actually specify the path doesn't help either.
All of this is done using a terminal created from the Docker Quickstart on Windows ` Server: |
@pewsey thanks for the detailed repro steps! I don't have access to a windows machine, but wondering if adding a double slash helps;
I think that prevented some "magic" conversion |
Is the result. From my (brief) understanding - the winpty command "should" fix all that escaping issues. I suspect it's something more heinous happening under the covers. |
Is there an update on this one? Fixed in a future build? Never to be fixed? |
Hi all, I'm running Windows 10 and I can't use mount volume with docker. I have no error displayed but all sync folders are empty. I hope a fix or workaround can be quickly deployed. |
ping @jhowardmsft is this something that needs a fix in docker/docker? |
At a Linux or Windows daemon? No idea about the winpty thing, I just run from native cmd or Powershell, not from bash and winpty that might inappropriate munge and escape paths (such as the double back-slashes in the example). If pointing at a Windows daemon, it needs to be in Windows semantics. eg docker run -v c:\path:d:. If pointing at a Linux daemon, it needs to be in Linux semantics eg docker run -v /foo:/bar. All this assumes you are running a daemon and client with the volume PR merged (such as TP4 or later, can't remember exact date of merge, but something like Nov 23rd was TP4 final, I think you're close on Nov 20th). |
@jhowardmsft thanks for that. You can see my attempts above. Can you craft me a working command line from your perspective. It would be great if you could try it using the Windows "Docker Quickstart". I'm not 100% convinced it's not me doing something insane - but I have tried a few permutations which I've documented above and it's not behaving like I'd expect. If there's anything else I can do to help this - please feel free to reply to me here. I'd really like to know how to get this to work. For clarity - the host environment is Windows 10 and the VirtualBox environment is Ubuntu. |
@jhowardmsft That's not the problem that we're having here. Docker running on an ubuntu VM under Windows isn't quite the same as installing the Docker Toolbox on Windows ;) Which is where the problem is. Your docker client is just talking to the docker daemon inside your VM, mounting a linux path. our problem is trying to mount a Windows path, like this:
But it doesn't work. Miserably so :( |
Ah, AFAIK you can't do that from either a Linux or a Windows client. The volume is on the host running the daemon, not on the client. |
@jhowardmsft You can mount any folder that the daemon can see. Macs have a similar layout (only mac, not Windows, of course). On my Mac I have no problem doing the same thing. The virtual machine that Docker creates mounts the |
@waynew do you have any logs we can have a look at? |
Oh nvm, it's a client-only issue? |
I assume it's a server issue. I don't actually have a Windows machine at my disposal, but I suspect this is the case for any/all windows machines that try to mount a windows volume in the container. |
This looks like a client issue, particularly with mflag parsing the options. |
This issue is resolved for my particular use case. Thank you for whatever happened. I suspect it was as cpuguy83 mentioned - some CLI parsing errors. |
i am still having this issue
actually its behaving really weirdly i tried this:
as you can see, some folders are shown ... but most are not ....
anyway, the problem is the same. when i mount a folder from windows machine ... its empty inside docker container. however mounting /c/Users works as expected ... |
@ppisljar I think that is expected; by default, only the |
I have same problem as @legrandjeremy I'm running Windows 8.1 and I can't use mount volume with docker. I have no error displayed but all sync folders are empty. For example, i have file in c:\users\german\volumes on my host windows machine.
And folder /german in container is empty. |
i got it working with -v /c/Users/german/volumes:/german (note the capital U in users) thanks @thaJeztah |
Good to hear, and that actually makes sense, because the Virtual Machine runs Linux, and uses a case-sensitive filesystem, therefore |
I'v found why this doesn't work:
Because container runs not with -d (as daemon), and after run we immediately have command line to container. And in this point of time, has not yet finished mounting, and that's why we have empty folder.
or
My bad |
I am running on 1.10.3. Noticed @thaJeztah removed this from 1.10.3 but I am still experiencing the problem. For instance with
if I then go on the machine and do ls on /logs the folder is empty
Also I am not sure if related to Windows or the container. If uncommenting the docker nginx.conf volume abote i also get error
Is these related to this issue? Any suggestions? Should i open a separate one? |
I'm running version 1.12.0. |
I can confirm that the process described by @gabehesse results in a properly mounted volume (located on the drive(s) selected in Docker for Windows client's settings) on a new installation of Windows 10. |
To clarify, @fehergeri13 posted a screenshot of the solution provided by @gabehesse. |
For a mingw bash shell, this is what docker toolbox adds (for example in bashrc) to stop mingw from corrupting the paths:
|
I'm closing this issue because all issues reported here seem to either be an issue with mingw, docker toolbox / VirtualBox guest additions, or docker for windows; for issues with "docker for windows", please use the dedicated issue tracker: https://github.com/docker/for-win/issues. For docker toolbox, please use https://github.com/docker/toolbox/issues. This is not a bug in the "docker engine", so there's not a lot we can do in this repository, so I'll close |
When running Docker (1.9) under Windows 8, attempting to mount a volume fails miserably:
This is being run from the mingw prompt.
What am I doing wrong here?
The text was updated successfully, but these errors were encountered: