Run Different Linux OS in Docker Container?

后端 未结 2 538
一向
一向 2021-01-30 08:08

Have been trying to learn Docker and one thing that puzzles me is how a different flavour of Linux (to the host OS) actually runs in the Docker container.

If we assume m

2条回答
  •  春和景丽
    2021-01-30 08:48

    I think this previous post may help you understand it a little more - Docker container isolation, does it care about underlying Linux OS?.

    The crux of the matter is that if the Host OS is RedHat then it is the RedHat kernel which will be used by whatever build of Linux you run in your Docker container ie. Ubuntu in your example.

    This comes down to understanding what the difference is between a Linux OS and a Linux Image. You will not be running a full Ubuntu OS inside the Docker Container but an image of Ubuntu.

    For the purpose of your question think:-

    OS = kernel + filesystem/libraries
    Image = filesystem/libraries

    The Ubuntu image running inside your Docker container is just the Ubuntu filesystem/libraries - it will not contain the Ubuntu kernel. This partly explains the efficiencies you get from a Docker container which is leveraging the Kernel (among other things) of the underlying Host.

提交回复
热议问题