I am trying to understand how Docker Desktop for Mac works. Specifically, an overview of the architecture.
There is an image of the generic architecture on the "Overview" page of the "Getting Started" guide.
However, this does not explain the distinction between Docker on Linux (which runs natively) and Docker Desktop on Mac (which runs inside a Virtual Machine).
I would assume things would look a bit like this:
But this is a gross oversimplification, things are missing from this picture.
How does the architecture of Docker Desktop on mac look?
I’ve tried piecing things together for myself, but there seems to be a lot of incomplete or conflicting information online. Often it is not clear whether the information given relates to the deprecated Docker Toolbox, Docker Machine or Docker for Mac, or to Docker Desktop on Mac.
2
Answers
I am not an expert in the internals of Docker Desktop but your guest is correct, Docker will only run natively in Linux systems, in Windows and macOS you need some kind of hypervisor technology to provide the necessary capabilities to run the Docker engine.
In Windows, you can choose between using Hyper-V and the new backend based on WSL2.
In macOS, Docker Desktop on Mac uses different components, especially HyperKit, an hypervisor for macOS built using the Hypervisor.Framework originally derived from xhyve.
Please, consider read this related SO question as well, despite the fact it is Windows based I think it could be of help.
In this link you can find part of the information you are looking for, it can serve as a starting point for the information you are looking for
https://collabnix.com/how-docker-for-mac-works-under-the-hood/
image from collabnix.com:
the configuration of linux VM for MAC Hyperkit can be found in this repository
https://github.com/linuxkit/linuxkit/blob/master/examples/docker-for-mac.yml