You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
In Windows install Ubuntu-20.04 as a WSL distro.
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"
In Windows create a file (for example, z.txt) under U:\tmp\a
In PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
In the container: ls. Nothing will be printed*
In the container: echo d > c.txt ; ls. c.txt will be printed
In the container: exit
Once more in PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
In the container: ls. c.txtwill be printed
In the container: exit
In Windows check the content of U:\tmp\a. There is no c.txt
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
In Windows remove the U:\tmp\a directory completely.
In PowerShell: docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
In the container: echo d > c.txt ; ls. c.txt will be printed
In the container: exit
In Windows check that the U:\tmp\a directory is created but there is no c.txt inside
The text was updated successfully, but these errors were encountered:
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
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.
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
tooa. 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"
z.txt
) underU:\tmp\a
docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
ls
. Nothing will be printed*echo d > c.txt ; ls
.c.txt
will be printedexit
docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
ls
.c.txt
will be printedexit
U:\tmp\a
. There is noc.txt
\\wsl$\docker-desktop\tmp\docker-desktop-root\mnt\host\uC\wsl$\Ubuntu-20.04\tmp\a
. There isc.txt
with "d" insideU:\tmp\a
directory completely.docker run -it --rm -v "U:\tmp\a:/opt/b" -w /opt/b busybox
echo d > c.txt ; ls
.c.txt
will be printedexit
U:\tmp\a
directory is created but there is noc.txt
insideThe text was updated successfully, but these errors were encountered: