docker is not VM , why container need base image OS ?

cola picture cola · Dec 29, 2013 · Viewed 12.8k times · Source

It is said that docker is not a VM and containers directly run on the host.

But why do containers need a base image OS ?

If process in containers run on the base image OS , what's the difference between a VM and docker(only the base image OS can be re-used and kept read-only?)

And why does it boot faster than a VM?

What makes up a base image OS ? kernel , rootfs or both?

Answer

ondrasek picture ondrasek · Dec 29, 2013

You might want to refer to this blog post: http://www.activestate.com/blog/2013/06/solomon-hykes-explains-docker

Simply put, Docker does a process isolation leveraging LXC (a kind of lightweight virtualisation built into Linux Kernel). The basic difference between LXC and VMs is that with LXC there is only one instance of Linux Kernel running. The base image OS is used for filesystem, binaries, etc.