1

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:

enter image description here

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.


[UPDATE]: I came across this overview in a blog post on docker.com from 2016 which seems to be more or less what I am looking for, but I do not know enough of Docker to judge whether that information is still correct (or even relevant) today.

enter image description here

Potherca
  • 13,207
  • 5
  • 76
  • 94
  • I understand the difference between docker and a VM. What I am looking for is the difference between docker on linux (which runs natively) and Docker Desktop on mac (which uses a VM). The [getting started overview in Docker Docs](https://docs.docker.com/get-started/overview/) has an overview but it does not explain this distinction: https://docs.docker.com/assets/images/architecture.svg – Potherca Jun 04 '23 at 14:16
  • Not a dev question. – Richard Barber Jun 04 '23 at 22:21
  • 1
    @RichardBarber "As a developer, using docker in development, I want to understand how this development tool works". How is that not a dev question? – Potherca Jun 06 '23 at 08:17
  • I believe the question may have been too general for some forum users, that’s all. – Richard Barber Jun 06 '23 at 18:16

2 Answers2

2

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:

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

rafapc2
  • 406
  • 4
  • 7
  • Although my answer have certain context regarding the hypervisor depicted in your diagram, I think that nowadays Docker for XXX offers a rich amount of functionality and modules, and your answer describes it better. Good job. – jccampanero Jun 12 '23 at 23:20
1

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.

jccampanero
  • 50,989
  • 3
  • 20
  • 49