49

I am using a mac and apparently installing Docker Desktop is mandatory to use Docker in macOS. Why Docker Desktop is required in Mac and Windows OS, and not in Linux? What purpose Docker Desktop serves? I have tried googling it but can't find appropriate answers.

Half Blood Prince
  • 951
  • 2
  • 13
  • 25
  • 2
    Similar, though not quite a dupe: https://stackoverflow.com/questions/38464724/whats-the-difference-between-docker-for-windows-and-docker-on-windows/40320748 – SuperStormer Feb 22 '21 at 14:12
  • 3
    I hope someone can provide a more detailed answer to this, but generally speaking, Docker requires a Linux host. Docker Desktop provides some sort of Linux virtual machine in which Docker can run. That isn't required on a Linux system, because it is already Linux :) – jkr Feb 22 '21 at 14:12
  • 1
    @jakub I also thought that might be the case but couldn't find it documented anywhere. So is Docker only supposed to run on Linux? And if we wish to run it on mac/windows we'll need to run it on Linux VM? Is that the case? – Half Blood Prince Feb 22 '21 at 14:29

2 Answers2

29

docker desktop for both mac and windows is using a Linux virtual machine behind the scenes for running regular docker daemon.

Reference That state docker for windows is using WSL2 which is running a VM.
Here there is a mention of backing up docker VM on docker for mac.

Docker Desktop handles the setup and teardown of lightweight VMs on both Windows and macOS, using Hyper-V on Windows desktops and Hyperkit on macOS.

From docker blog .

Shmuel
  • 1,568
  • 10
  • 20
  • 1
    Is this documented somewhere? – Half Blood Prince Feb 22 '21 at 14:15
  • 3
    I updated my answer with link that mentioned the VM not directly, I'm sure you can find more about this with a little search. Also on windows you can just list WSL in powershell and there is WSL running for docker. – Shmuel Feb 22 '21 at 14:32
  • 1
    Thanks for the update. Yes, this links mentions running VM in the background. – Half Blood Prince Feb 22 '21 at 14:36
  • 8
    So the 64,000 dollar question (literally, if you have a big enough team) is: if you install docker desktop but only use docker _engine_ via the CLI, are you using docker desktop? And also/if so, can you get docker _engine_ running on a mac on a VM without docker desktop? – Oliver Williams Jul 21 '22 at 15:32
  • @OliverWilliams: "if you install docker desktop but only use docker engine via the CLI, are you using docker desktop?" --> yes, because you would have not got Docker Engine without Docker Desktop. Of course, you can install Docker Engine standalone as well. – hagrawal7777 Jul 23 '23 at 11:45
  • @OliverWilliams: "can you get docker engine running on a mac on a VM without docker desktop?" --> yes, it is possible. – hagrawal7777 Jul 23 '23 at 11:46
5

Docker: It is the main service which runs containers, this runs on linux kernel (linux VM on Mac and Windows), docker is open source and free to use. Alternatives to docker are Podman.

Docker Desktop: It is the commercial GUI tool, which helps us to run, list, edit etc. our container configs. This is free to use (but at some extent like big orgs need to buy licenses to use it for commercial developments).

blackgreen
  • 34,072
  • 23
  • 111
  • 129
Neeraj Bansal
  • 2,580
  • 16
  • 8