Reputation: 177
This may seem like a silly question, but I am a beginner to containerization concept and I was wondering why the ubuntu image size(~80mb) from docker hub is very much lesser than its iso file(~1.8GB)
Upvotes: 2
Views: 797
Reputation: 1
Docker container made by the image is a isolated space which depend on our host OS Kernal using docker. so they wanted to make it much smaller and lighter as they can, to do that they drop many things even GUI(which even us drop on purpose some times in VMs to save some specs) and it does only have some libraries (I coudn't even run "systemctl"). this is how they make it lighter and hope you find the answer ..
Upvotes: 0
Reputation: 186
Container is an isolated space of your Kernel.
On ubuntu:18.04 docker image, it doesn't contain entire Kernel binaries.
It only has some libraries and executions with some configuration required to run ubuntu:18.04, it still uses your host's Kernel.
You can take a look at how does ubuntu:18.04 image created from Dockerfile from here.
I recommend you to search how Docker use cgroups
and namepaces
to create container.
Upvotes: 3
Reputation: 1457
Docker images contains only necessary minimum library and tools which is in fact needed to be an operating system running.For Ubuntu docker images, its does not have any GUI(which is not used in container or rarely used) and most tools are also not included.Its just a base operating system.Alpine images are too much smaller than the Ubuntu images.
Upvotes: 1