Skip to content
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

docker resolves path of mapped network drive incorrectly #11151

Open
3 tasks done
NickVeld opened this issue May 9, 2021 · 4 comments
Open
3 tasks done

docker resolves path of mapped network drive incorrectly #11151

NickVeld opened this issue May 9, 2021 · 4 comments

Comments

@NickVeld
Copy link

NickVeld commented May 9, 2021

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID: I checked too much information is gathered but it is mostly useless here, just reproduce the behavior

Actual behavior

Docker creates (if it does not exist) the directory in the right place on the host system (U:\tmp\a, /tmp/a inside Ubuntu under WSL)
but mounts the directory from \\wsl$\docker-desktop\tmp\docker-desktop-root\mnt\host\uC\wsl$\Ubuntu-20.04\tmp\a

Expected behavior

Docker mounts U:\tmp\a correctly.

Information

I got message that I "shared a Windows file into WSL2 container"
and get no recipe how to mount it properly from my IDE on Windows (ouch!)
thus I tried to figure out it myself.
I had already mapped my "network drive" for the Ubuntu distro as a U: disk.
So I moved my project into the WSL filesystem and tried to mount the path that starts with "U:" now as usual.
As the result I kept getting the empty directory
(it is quite close to #2151
but it has been long time, different setting and new detail (actual mounting path) so I opened a new issue;
however, this comment #2151 (comment) seems more related to this issue).
I created a file, closed (and with the help of --rm removed) the container,
run new one with the same setting and observe that the file was still in the directory!
It meant that the path is not mounted from nowhere but from the specific place.
My next step was searching through the filesystems. Finally, I have found it and now I am sharing my finding here.

  • Windows Version:
"os": "Windows 10 Pro 10.0.19042",
"os_label": "win/19042",
  • Docker Desktop Version: 3.3.1 (Why it does not have the "about" window with the version? I have found only tips that uses the registry and using them figure out to check the Windows app list with the "Uninstall" buttons...)
  • WSL2 or Hyper-V backend? WSL2
  • Are you running inside a virtualized Windows e.g. on a cloud server or a VM: Windows is a host system

Steps to reproduce the behavior

In my experiments I used my user's home but for the reproductivity I tested it in easy-accessible /tmp too

  1. In Windows install Ubuntu-20.04 as a WSL distro.
  2. In Windows map its location as a drive if it is not mapped
    a. Open Windows Explorer (you must see libraries, you drives and maybe network locations in the windows)
    b. Select the "Computer" tab (in the top-left corner)
    c. Click on "Map network drive..."
    d. Drive: "U:"; folder \\wsl$\Ubuntu-20.04, untick "Reconnect at sign-in" and "Connect using different credentials".
    e. "Finish"
  3. In Windows create a file (for example, z.txt) under U:\tmp\a
  4. In PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
  5. In the container: ls. Nothing will be printed*
  6. In the container: echo d > c.txt ; ls. c.txt will be printed
  7. In the container: exit
  8. Once more in PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
  9. In the container: ls. c.txt will be printed
  10. In the container: exit
  11. In Windows check the content of U:\tmp\a. There is no c.txt
  12. In Windows check the content of \\wsl$\docker-desktop\tmp\docker-desktop-root\mnt\host\uC\wsl$\Ubuntu-20.04\tmp\a. There is c.txt with "d" inside
  13. In Windows remove the U:\tmp\a directory completely.
  14. In PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
  15. In the container: echo d > c.txt ; ls. c.txt will be printed
  16. In the container: exit
  17. In Windows check that the U:\tmp\a directory is created but there is no c.txt inside
@NickVeld
Copy link
Author

NickVeld commented May 9, 2021

Note: Mounting \\wsl$\Ubuntu-20.04\tmp\a works fine

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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.
/lifecycle stale

@NickVeld
Copy link
Author

/remove-lifecycle stale

@NickVeld
Copy link
Author

/lifecycle frozen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants