Reputation: 1774
I am new to docker and trying to understand the concept of base image.
Let's say I have a hello-world docker app on windows machine with ubuntu as base image in Dockerfile.
Now to run this hello-world application, Is docker going to install the whole ubuntu to run the application?
If not then how ubuntu base image will be used here and How will Docker container facilitate the commutation between ubuntu based application and windows OS?
Upvotes: 5
Views: 2631
Reputation: 1323403
Now to run this hello-world application, Is docker going to install the whole ubuntu to run the application?
No, the ubuntu image used is not "the whole ubuntu". It is a trimed-down version, without the all X11 graphic layer. Still 180 MB though: see "Docker Base Image OS Size Comparison".
These days, you would rather use an Alpine image (5 MB): see "Docker Official Images are Moving to Alpine Linux"
Regarding the hello-world application specifically, there is no Ubuntu or Alpine involved. Just 1.8 KB of C machine-code, which makes only direct calls to the Linux kernel of the host.
That Linux host is used by docker container through system calls: see "What is meant by shared kernel in Docker?"
On Windows, said Linux host was provided by VirtualBox VM running a boot2docker VM, built from a TinyCore distro.
With the more recent "Docker for Windows", that same VM is run through the Hyper-V Windows feature.
Upvotes: 8