Is there a pictorial diagram of how WSL 2, Docker, Docker-desktop ... are related?

Still trying to wrap my head around the relationship between

WSL 2, Docker, the WSL listed distros (wsl -l) docker-desktop and docker-desktop-data, Microsoft Hyper-V and the WSL Ubuntu distribution.

As @tekki noted by correcting me in this other post that I am way off.

While there is a useful amount of text on this, as we know pictures are worth a thousand words and so would like to ask for a picture of how these can/are composed as one image. I can find lots of images but none that show all of the parts in one image. I would make my own image but suspect I would get something wrong.


EDIT

This looks close.

From:
Containers engines war: Why Docker is not necessarily the best choice? MicroVMs Solutions Part2 (ref)

Obviously missing docker-desktop and docker-desktop-data, or at least it is not labeled in this image. Need to check what else might be of value that is missing.

1 Like

I’m not totally sure a picture will help because there are several options and it possibly doesn’t help to know about the low-level architectures. Here’s an overview…

Docker runs on Linux.

To make it work on Windows, you need a Linux Virtual Machine. The options are Hyper-V or WSL2 (which uses Hyper-V but integrates Linux distros into Windows so the experience is more seamless). WSL2 is the best option - and the only one if you’re using Windows Home.

When you install Docker Desktop on Windows, you can choose:

  • Hyper-V. It’ll install it’s own Linux VM for Docker use (you can’t use it for anything else). You can then run Docker commands from the Windows command line.

  • WSL2. You need to install at least one Linux distro in WSL2 first (Ubuntu is a good choice). Docker commands can then be run from that distro’s bash prompt OR from the Windows command line. In either case, containers still run inside Linux.

(You cannot install Linux Docker inside a WSL2 Linux - it won’t work. You could install Linux Docker on Hyper-V VM, but there’d be few advantages for doing so.)

This may help: Windows Subsystem for Linux 2: The Complete Guide.

1 Like

Thanks, but for what I am doing, using WSL 2, Docker, Windows Terminal, and Visual Studio Code with remote development extensions, the info in the link ends where I was at two days ago.

The current problem I am working on is that the app (swipl-win) uses X11 for a GUI debugger. Making progress but with holes in my understanding the underlying components and how they interconnect is a try, fail repeat exercise. Not frustrating but just time consuming. Right now have to create a new Dockerfile for swipl-win because the DockerHub variation (swipl) does not include the GUI code.


Did not know about the difference of how the choices for installing Docker Desktop affected the underlying components. :slightly_smiling_face: