Reputation: 8687
When running docker desktop on Windows with Hyper-V I have a single VM called DockerDesktopVM where my Linux VM is running with it's containers inside.
However when I run docker desktop with the WSL engine I see that it creates 2 WSL distros.
I can shell into the docker-desktop distro like I would any other distro.
But trying to do the same to docker-desktop-data just bounces me out.
So my question is what is the docker-desktop-data distro for and why does it exist separately from the docker-desktop distro? Clearly the name implies data but what specific data and why can't I jump into the distro as I would any other?
Upvotes: 62
Views: 47634
Reputation: 146
Clearly the name implies data but what specific data and why can't I jump into the distro as I would any other?
I'm not sure why this hasn't been noted yet so I'm guessing it's just not known here maybe
If you go into your file browser, at least the built in explorer, but any should work, you can browse to all running WSL2 file systems by going to \\wsl.localhost
or \\wsl$
from the same machine.
Because of how WSL2 works the VHDs aren't actually mounted, they're essentially created as network drives that are mounted in the WSL Distro... More or less.
The docker-desktop-data is where all the images & things are stored. \\wsl$\docker-desktop-data\data\docker\volumes\
is litteraly where all your volumes exist. You know how you need an agent to be able to browse volumes in Portainer? You can literally just go here & browse them like any windows folder.
The images I believe are in the \\wsl$\docker-desktop-data\data\<<FOLDERS WITH containerd IN THE NAME>>\
folders as the size seems to match up, but sadly it's not really useful to browse & should be treated carefully.
While the accepted answer gives the "what is it" & "why does it exist separately" answers the "What data" & "why can't I get into it" were missing. I personally feel the volume browsing is the most useful thing you'll do there as it's a lot more convenient than any other access method, but the whole file structure is there however you wish to use it
Upvotes: 3
Reputation: 8687
The docker-desktop-data distro is used by the docker-desktop distro as the backing store for container images etc. When docker is run under Hyper-V the same result is achieved by mounting a VHD in the Hyper-V image but this isn't possible with WSL2.
To quote from the docker blog introducing the new wsl2 backend:
This will create 2 WSL distros for you:
Docker-desktop, which I’ll call the bootstrapping distro Docker-desktop-data, which I’ll call the data store distro
From a high level perspective, the bootstrapping distro essentially replaces Hyper-V, while the data store distro replaces the VHD that we previously attached to the VM.
The bootstrapping distro creates a Linux namespace with its own root filesystem based on the same 2 iso files we mentioned earlier (not entirely true, but close enough), and use the data-store distro as the backing store for container images etc. instead of a VHD (WSL 2 does not allow us to attach additional VHD at the moment, so we leverage cross-distro mounts for that).
To prevent you from being able to wsl -d ubuntu-desktop-data
the distro has a 0-byte /init
.
The blog post is a great introduction to how docker on wsl works.
Upvotes: 62
Reputation: 19
As I can see a '*' just before 'docker-desktop' means it is the head or main branch of it. So '-d' command will run on that only. Try switching it to 'docker-desktop-data' then you may be able to run the specific distribution.
Upvotes: -1