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?
No its not like that. To create any docker image using DockerFile, You need to start with a base docker image. That base docker image can be anything, Like an empty image as well, In the docker file in your example the FROM section says ubuntu, it means its assuming ubuntu as the base image.
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.
A base image is the image that is used to create all of your container images. Your base image can be an official Docker image, such as Centos, or you can modify an official Docker image to suit your needs, or you can create your own base image from scratch.
Docker does not has an OS in its containers. In simple terms, a docker container image just has a kind of filesystem snapshot of the linux-image the container image is dependent on.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With