How does Docker run the Linux kernel under the macOS host?

I installed Docker on my macOS Sierra as follows. Note. I do not have VirtualBox installed.

brew cask uninstall virtualbox
brew cask install docker

My macOS options.

$ uname -a
Darwin m-C02QG7TRG8WN.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Tue Mar 28 00:40:02 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Mar 24 00:00:50 2017
 OS/Arch:      linux/amd64
 Experimental: true

As soon as I launch Docker from the launchpad, I can launch Docker containers.

$ docker run -it ubuntu
root@2351d4222a4e:/# uname -a
Linux 2351d4222a4e 4.9.13-moby #1 SMP Sat Mar 25 02:48:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

My question is, how does Docker manage to run the Linux kernel on macOS? I thought Docker would at least require boot2docker or another such Linux kernel so that it could create an Ubuntu file system with it. But the above conclusion seems to indicate that this is not the case. Where does the Linux kernel come from?

+24
source share
3 answers

Docker VirtualBox Docker. 2016 Docker Mac Windows , Docker Mac/Windows, - docker mac:

Docker Mac - , MacOS Hypervisor, .

:

enter image description here

+18

, .

: "Docker [Desktop] Mac" Linux boot2docker - LinuxKit, Docker .

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

uname, , , , , , . Docker Mac 18.03.1 :

Linux a8e079429a51 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 Linux

. https://docs.docker.com/docker-for-mac/release-notes/

Docker Machine + VirtualBox + boot2docker,

provisioning is done internally "Docker [Desktop] Mac" and VirtualBox is replaced by Apple Hyperkit, the "default VM" is a bit more tucked away.

+15

Docker Apple Hypervisor Framework: https://developer.apple.com/reference/hypervisor

Read more on Docker blogs when they came out last year: https://blog.docker.com/2016/05/docker-unikernels-open-source/

+4
source

Source: https://habr.com/ru/post/1016515/


All Articles