Saturday, November 05, 2022

Docker volumes on Windows WSL2

Docker Desktop is very useful developers tool.

And when running on Windows, optimally it should be on WSL2, 
that is a full Linux kernel embedded into windows.

And while the system works very well, it is still slightly different than Linux or Mac

WSL2 filesystem is visible from Windows

from windows explorer
\\wsl$\docker-desktop

From command prompt (i.e. PowerShell)

# see docker volumes
docker volume ls

# see WSL2 dirs/volumes
wsl -l -v

# list docker volume dirs in Windows
dir
 Directory: \\wsl$\docker-desktop-data\data\docker\volumes

# see contenet of docker volume
cd myvolume\data
dir Directory: \\wsl$\docker-desktop-data\data\docker\volumes\myvolume\_data Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 11/5/2022 2:55 PM network ----- 10/2/2022 5:21 PM 306 group ----- 11/5/2022 2:55 PM 0 hostname ----- 11/5/2022 2:55 PM 0 hosts ----- 10/1/2022 5:34 PM 118 localtime l---- 11/5/2022 2:55 PM 12 mtab -> ----- 10/2/2022 5:21 PM 340 passwd ----- 11/5/2022 2:55 PM 0 resolv.conf ----- 10/24/2022 8:08 PM 136 shadow

windows subsystem for linux - Where are Docker volumes located when running WSL using Docker Desktop? - Stack Overflow






No comments: