What is the docker-desktop-data distro used for when running docker desktop with the WSL 2 engine
Apr 23
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.
- docker-desktop
- docker-desktop-data
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?
1 answer
Accepted answer · original discussion
Apr 25
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 distroFrom 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.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.