In Docker ,guest OS share same kernel as Host OS have .
Can someone elaborate more on it.
Let I have centos os which have some kernel version ,when we pull ubuntu image then it have different kernel ,then how can we say that they have same kernel?
In Docker ,guest OS share same kernel as Host OS have .
Can someone elaborate more on it.
Let I have centos os which have some kernel version ,when we pull ubuntu image then it have different kernel ,then how can we say that they have same kernel?
No it does not: it does not have the kernel part: it relies on the kernel of the host (the one running docker engine) for all system calls.
As mentioned in "Docker vs Virtualization":
See more at "Why Understanding User Space vs. Kernel Space Matters".
Also "Operating System Containers vs. Application Containers":
As mentioned in "Do all Linux distros use the same kernel?", a kernel can be shared accross distro, even if each distro has its own configuration of the kernel.
Docker was using LinuX Containers (LXC) earlier, but switched to runC (formerly known as libcontainer), that runs in the same operating system as its host. This allows it to share a lot of the host operating system resources. It also uses layered filesystems like AuFS. It also manages the networking for you as well.
AuFS is a layered file system, so you can have a read only part, and a write part, and merge those together. So you could have the common parts of the operating system as read only, which are shared amongst all of your containers, and then give each container its own mount for writing.
So let's say you have a container image that is 1GB in size. If you wanted to use a Full VM, you would need to have 1GB times x number of VMs you want. With LXC and AuFS you can share the bulk of the 1GB and if you have 1000 containers you still might only have a little over 1GB of space for the containers OS, assuming they are all running the same OS image.