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?
Docker Desktop for Windows provides a development environment for building, shipping, and running dockerized apps. By enabling the WSL 2 based engine, you can run both Linux and Windows containers in Docker Desktop on the same machine.
WSL 2 also provides a mechanism for running Docker (with Linux containers) on your Windows machine. We'll install it as a prerequisite for Docker Desktop for Windows. If you're running Windows Home, WSL 2 is the only way to run Docker Desktop.
Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and share containerized applications and microservices.
Both your own WSL 2 distro and docker-desktop run on the same utility VM. They share the same Kernel, VFS cache etc. They just run in separate namespaces so that they have the illusion of running totally independently. Docker Desktop leverages that to handle bind mounts from a WSL 2 distro without involving any remote file sharing system.
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.
The name is giving us a clue, the docker-desktop-data distro exists as a storage for images and configs, as well as the Kubernetes data store.
To enable the WSL engine, I just need to go to Settings -> General and turn on Enable the experimental WSL 2 based engine. Once I Apply & Restart docker will restart and my DockerDesktopVM will no longer be running.
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).
The blog post is a great introduction to how docker on wsl works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With