Skip to content
Advertisement

How does Docker run a Linux kernel under macOS host?

I installed Docker on my macOS Sierra as follows. Note I don’t have VirtualBox installed.

JavaScript

My macOS details.

JavaScript

Once I run Docker from launchpad, I am able to run Docker containers.

JavaScript

My question is how does Docker manage to run a Linux kernel within macOS? I thought Docker would at least require boot2docker or some other such Linux kernel running so that it can create the Ubuntu’s filesystem with the help of it. But the above output seems to indicate that it is not so. Where does the Linux kernel come from then?

Advertisement

Answer

While the other answers are correct about the hypervisor, they don’t answer your specific question.

The answer is “Docker [Desktop] for Mac” does run a Linux host VM with a replacement for boot2docker – LinuxKit developed and maintained by Docker for the purpose of making lightweight distributions.

https://blog.docker.com/2017/04/introducing-linuxkit-container-os-toolkit/

The uname you saw didn’t have the keyword in it, but it seems to be included now, e.g. from Docker for Mac 18.03.1 I see:

JavaScript

You can see links to the included versions on the release pages. https://docs.docker.com/docker-for-mac/release-notes/

So it’s not so different from the old days Docker Machine + VirtualBox + boot2docker,

for the new days, it’s just the provisioning is done internally by “Docker [Desktop] for Mac” and VirtualBox is replaced by Apple's Hyperkit, and the "default VM" is a bit more tucked away.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement