Please tell me why the Docker container can use the host OS kernel.

Asked 1 years ago, Updated 1 years ago, 46 views

When I looked at the difference between Docker and VM, I realized that while VM works with OS, Docker containers can use the kernel of the host OS, and other libraries and apps are included in the Docker containers.

That's when the title-like question came to mind.
The operating system kernel should be different for each operating system, which means that when the host operating system runs Linux on the Docker container in Windows, it runs Linux using the Windows kernel.
Can I use the Windows kernel to run Linux?
I tried to figure out how this could happen, but I couldn't get an answer.

Please tell me why the Docker container can use the kernel of the host OS kernel.
The purpose of this question is to understand the difference between Docker and VM.
If the purpose of this question is clear, I would appreciate it if you could understand it and guide me.

Thank you for your cooperation.

linux windows docker macos

2022-09-30 17:38

2 Answers

If the host OS is running Linux on the Docker container in Windows, it means running Linux using the Windows kernel.

"When the host OS runs Linux on the Docker container in Windows" is interpreted as referring to Docker for Windows.

Docker for Windows is currently running Linux on a Windows Hyper-V VM, in which Linux containers are running.You do not use the Windows kernel to run Linux.


2022-09-30 17:38

I have forgotten the technical term details, but I remember that it was as follows:

I remember that Linux had the ability to run the entire running process environment file system with the kernel intact.In addition, docker should have been able to complete it by adding various libraries such as layered virtual file systems.

There is no docker, so it must be on Linux as the OS kernel. I remember docker for {Mac, Windows} running Linux VMs internally to run the Linux kernel (and the operating system that contains it).

http://docs.docker.jp/engine/installation/mac.html

For example, I think the above page and so on describe how this peripheral tool works in the official documentation.If the docker for Mac was installed by a native installer, I think it is probably running virtualbox internally.


2022-09-30 17:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.