Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Docker for Windows run Linux containers?

In the old versions of Docker for Windows, I remember it explicitly said it used a linux VM for the kernel.

But since the new stable version (released in July 2016 I think), it says

Docker for Windows is a native Windows application with a native user interface and auto-update capability, deeply integrated with Windows native virtualization, Hyper-V, networking and file system

If I understand correctly, the specified base image is for the user space and the host's kernel is used. So, if I specify that I'm using an ubuntu base image to run the echo command, how does the Windows kernel come into play?

Or am I completely misunderstanding something?

like image 918
MrVoodoo Avatar asked Jan 09 '17 14:01

MrVoodoo


People also ask

Can I build a Linux Docker container on Windows?

Windows 10 contains built in support for Windows Containers and Hyper-V Containers. Additionally, you can run Linux containers using Hyper-V, a minimal Linux kernel and userland in the Windows 10 Fall Creators Update and in Windows Server 1709 or later.

How does Docker containers work on Windows?

Docker is a containerization platform that runs applications within containers called Docker containers. Docker containers are light weighted when compared to virtual machines. When you install a Virtual machine on your system, it uses the guest operating system on top of your host operating system.

Does Docker use Linux containers?

The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64). Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.

Can same Docker image run on Linux and Windows?

No, you cannot run Windows containers directly on Linux.


1 Answers

Docker for Windows still uses a Linux VM to run Linux containers. But instead of using Virtual Box (which is what is used with Docker Toolbox), the Linux VM is run using Hyper-V - a Windows-native hypervisor. This means that Docker for Windows ships fewer components and has less moving parts.

If you install Docker for Windows and run docker version you'll see that the Docker Linux daemon is running on "Moby Linux".

like image 123
friism Avatar answered Sep 20 '22 11:09

friism