I'm learning about Docker. I feel stuck at the moment, I think that I have some wrong concepts about how Docker works, and that shadows how it actually works, but I can't really locate the problem. I will try to write a quick overview how I now think Docker works, please bear with me. At the moment I only want to make it work only on my local machine, hence nothing is deployed to a server in the outside world.

I have a WSL 2 Ubuntu distro installed on top of Windows 10. This means that I have virtualized my hardware to create a VM to run Ubuntu. In that VM, I want to create Docker containers, that will virtualize the Ubuntu OS, and share the kernel, creating containers where I can run my app.

In containers, there is no hypervisor, but still there is a thing that handles resources and other things. This is the Docker engine, in my setup the Docker Desktop for Windows, that contains the Docker engine. Here things start to get shady. Alongside the Ubuntu distro, I have two other WSL distros, docker-desktop and docker-desktop-data. It seems like these are used to implement Docker on WSL 2, and they are corresponding for a virtual machine running the Docker engine, and one for holding images, respectively.

The Docker Desktop installed on Windows is connected to the WSL environment. The Docker host is the docker-desktop distro, while the images are stored in the docker-desktop-data. This is the host that I connect to with my client to use the images that I create / download. I tried to see where my docker images are stored, I could not find them where some sources say they should be, but I found a folder dynamically growing when I am creating images, and that is C:\Users\Username\AppData\Local\Docker. But how come they are on the Windows file system (their routes from Linux being mnt/Users/Username/...) and not somewhere 'nearer' to the files separated for Linux Distros? And if it's stored there, why do my images need contexts for building? Is it the goal for these two distros, or are they doing something else as well?

These are a lot of questions. Please understand that I don't necessarily want the low-level implementations, I just want to see where are the many moving parts connected. Anything shedding some light on these questions would be really appreciated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.