-
Notifications
You must be signed in to change notification settings - Fork 286
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
[19.03.8] Binding folders are bind from MSYS2/MinGW #1509
Comments
Your mingw64
The double |
Thanks a lot @sgammill. May I know about any reference you might have found related to the change in the mount path inside the Moby VM? Until now, adding a slash to Might be related to #1284 and moby/moby#35425. |
I don't think it's related to LCOW. It's a change they made to the filesystem structure of the Moby VM. I stumbled on this like you did and then peeked inside the Moby VM and found out where the Windows drives were being mounted. |
With Windows docker.exe in Linux container mode, Windows-style host paths are interpreted as as paths on the Windows host, whereas Unix-style host paths are interpreted as paths in the Moby VM. I have the same use case as you. As a work-around, you can abstract
I'm not trying to prevent any RFE for host paths on Windows to work differently. I'm just offering the facts. |
Thank, again, for the workaround. Since I am going to use it in scripts that need to tell Windows and GNU/Linux hosts apart, it is clean enough for me. I will leave this issue opened anyway, so that maintainers can decide if it is worth an enhancement. |
Yes, we had to change where the drives are mounted in the linuxKit VM, but we do some translation of the mounted paths. Windows paths work a mentioned above : |
@gtardif , thanks for confirming that you had to change it. Unluckily, due to how MinGW/MSYS2 manipulates the paths, the format you mention ( user@host $ docker run --rm -v /d/test:/test alpine ls -R test
ls: test: No such file or directory
user@host $ docker run --rm -v /d/test://test alpine ls -R test
bash: /c/Program Files/Docker/Docker/resources/bin/docker: Bad address
user@host $ docker run --rm -v //d/test:/test alpine ls -R test
test:
user@host $ docker run --rm -v //d/test://test alpine ls -R test
test:
user@host $ docker run --rm -v D:/test:/test alpine ls -R test
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: invalid mode: \msys64\test.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
user@host $ docker run --rm -v D:\test:/test alpine ls -R test
test:
user@host $ docker run --rm -v D:\test://test alpine ls -R test
test:
user@host $ docker run --rm -v 'D:\test':/test alpine ls -R test
test:
testfile.md
user@host $ docker run --rm -v 'D:\test'://test alpine ls -R test
test:
testfile.md
user@host $ docker run --rm -v d:/test:/test alpine ls -R test
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: invalid mode: \msys64\test.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
user@host $ docker run --rm -v 'd:/test':/test alpine ls -R test
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: invalid mode: \msys64\test.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
user@host $ docker run --rm -v d:/test://test alpine ls -R test
bash: /c/Program Files/Docker/Docker/resources/bin/docker: Bad address
user@host $ docker run --rm -v 'd:/test'://test alpine ls -R test
bash: /c/Program Files/Docker/Docker/resources/bin/docker: Bad address Note that only these two work as expected: Of course, |
@gtardif Thanks for the mention that So I'll amend my observation: With Windows docker.exe in Linux container mode, Unix-style host paths are interpreted as paths on the Windows host if they're of the form ... This appears to be hold for host paths in @1138-4eb MSYS2 shell interprets a leading
These 4 docker commands should all accomplish the same thing. (Also, FWIW, to get |
@sgamill, according to your comments, I wrote this test script:
Summary of working formats:
It just confirms what you explained. I added it to have a quick test script. Thanks for the tip about |
Closing because this has been fixed in |
Reopening because there seems to be a regression in 2.2.0.5 (43884) stable: # winpty docker run --rm -itv $(pwd):/test alpine ls -la //
total 64
drwxr-xr-x 1 root root 4096 Apr 3 13:56 .
drwxr-xr-x 1 root root 4096 Apr 3 13:56 ..
-rwxr-xr-x 1 root root 0 Apr 3 13:56 .dockerenv
drwxrwxrwx 1 root root 0 Apr 3 13:56 \msys64\test
drwxr-xr-x 2 root root 4096 Jan 16 21:52 bin
drwxr-xr-x 5 root root 360 Apr 3 13:56 dev
drwxr-xr-x 1 root root 4096 Apr 3 13:56 etc
drwxr-xr-x 2 root root 4096 Jan 16 21:52 home
drwxr-xr-x 5 root root 4096 Jan 16 21:52 lib
drwxr-xr-x 5 root root 4096 Jan 16 21:52 media
drwxr-xr-x 2 root root 4096 Jan 16 21:52 mnt
drwxr-xr-x 2 root root 4096 Jan 16 21:52 opt
dr-xr-xr-x 128 root root 0 Apr 3 13:56 proc
drwx------ 2 root root 4096 Jan 16 21:52 root
drwxr-xr-x 2 root root 4096 Jan 16 21:52 run
drwxr-xr-x 2 root root 4096 Jan 16 21:52 sbin
drwxr-xr-x 2 root root 4096 Jan 16 21:52 srv
dr-xr-xr-x 13 root root 0 Apr 3 13:56 sys
drwxrwxrwt 2 root root 4096 Jan 16 21:52 tmp
drwxr-xr-x 7 root root 4096 Jan 16 21:52 usr
drwxr-xr-x 12 root root 4096 Jan 16 21:52 var
# winpty docker run --rm -itv /$(pwd):/test alpine ls -la //test
total 4
drwxr-xr-x 2 root root 40 Apr 3 13:57 .
drwxr-xr-x 1 root root 4096 Apr 3 13:57 ..
# winpty docker run --rm -itv /$(pwd)://test alpine ls -la //test
total 4
drwxr-xr-x 2 root root 40 Apr 3 13:57 .
drwxr-xr-x 1 root root 4096 Apr 3 13:57 ..
# winpty docker run --rm -itv $(pwd -W):/test alpine ls -la //
C:/Program Files/Docker/Docker/resources/bin/docker.exe: Error response from daemon: invalid mode: \msys64\test.
See 'C:/Program Files/Docker/Docker/resources/bin/docker.exe run --help'.
# winpty docker run --rm -itv /$(pwd -W):/test alpine ls -la //test
total 4
drwxrwxrwx 1 root root 4096 Apr 3 04:52 .
drwxr-xr-x 1 root root 4096 Apr 3 13:59 ..
-rwxr-xr-x 1 root root 12513 Mar 31 23:13 .bash_history
-rwxr-xr-x 1 root root 21 Dec 15 2018 .bash_logout
-rwxr-xr-x 1 root root 1255 Dec 15 2018 .bash_profile
-rwxr-xr-x 1 root root 5901 Jan 16 04:08 .bashrc
drwxrwxrwx 1 root root 0 Jan 23 01:26 .cache
drwxrwxrwx 1 root root 0 Jan 12 10:39 .config
-rwxr-xr-x 1 root root 158 Mar 9 18:11 .gitconfig
drwxrwxrwx 1 root root 0 Jan 12 10:36 .gnupg
-rwxr-xr-x 1 root root 3272 Dec 15 2018 .inputrc
-rwxr-xr-x 1 root root 1574 Dec 15 2018 .profile
-rwxr-xr-x 1 root root 88 Feb 19 15:12 .python_history
drwxrwxrwx 1 root root 4096 Mar 17 03:16 .ssh
drwxrwxrwx 1 root root 0 Mar 9 18:10 .vim
-rwxr-xr-x 1 root root 35507 Apr 1 00:36 .viminfo # winpty docker run --rm -itv /$(pwd -W)://test alpine ls -la //test
total 4
drwxrwxrwx 1 root root 4096 Apr 3 04:52 .
drwxr-xr-x 1 root root 4096 Apr 3 13:59 ..
-rwxr-xr-x 1 root root 12513 Mar 31 23:13 .bash_history
-rwxr-xr-x 1 root root 21 Dec 15 2018 .bash_logout
-rwxr-xr-x 1 root root 1255 Dec 15 2018 .bash_profile
-rwxr-xr-x 1 root root 5901 Jan 16 04:08 .bashrc
drwxrwxrwx 1 root root 0 Jan 23 01:26 .cache
drwxrwxrwx 1 root root 0 Jan 12 10:39 .config
-rwxr-xr-x 1 root root 158 Mar 9 18:11 .gitconfig
drwxrwxrwx 1 root root 0 Jan 12 10:36 .gnupg
-rwxr-xr-x 1 root root 3272 Dec 15 2018 .inputrc
-rwxr-xr-x 1 root root 1574 Dec 15 2018 .profile
-rwxr-xr-x 1 root root 88 Feb 19 15:12 .python_history
drwxrwxrwx 1 root root 4096 Mar 17 03:16 .ssh
drwxrwxrwx 1 root root 0 Mar 9 18:10 .vim
-rwxr-xr-x 1 root root 35507 Apr 1 00:36 .viminfo Both of these:
|
I'm not quite following all your test cases, but is it the same as #6209? |
@stephen-turner, it might be but, honestly, I am not sure. Both MSYS2/MINGW and WSL do provide a similar user experience, in the sense that drives are accesible as linux paths ( Regarding MSYS2, there are multiple approaches to use it with Docker for Win, which is (should be) unaware of the path conversion:
With the recent update, for the second case, there seems to be some issue that mounts the shared folder in the VM and in the container, but none of them is actually synced with the host. It is still possible to provide a windows syntax path directly (as done with Note that there was a similar regression two years ago. At that time, the erroneous behaviour was reported in #1509 (comment) |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
Is it possible to reopen this issue? |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Bind folders work in both PowerShell and MinGW.
Actual behavior
After updating to
17.12.0-ce-win46 (15048) Stable 0ac7325
, local folders bind to container volumes are not properly shown if docker is executed from MinGW.Information
E9FA3323-7ADF-49BB-A59A-73C64DC4AFC1/2018-01-09_21-24-26.
I'm pretty sure it is due to the update, because reverting to
Version 17.09.1-ce-win42 (14687) Stable 3176a6a
"fixes" it.Steps to reproduce the behavior
This works (17.12.0):
This also works (17.09.1):
This does not (17.12.0):
The text was updated successfully, but these errors were encountered: