If I pull a Ubuntu image from Docker Hub using docker pull ubuntu:14.04
and then list my images with docker images
I see that the Ubuntu image has a virtual size of just ~188MB. I don't understand why the image size is so much smaller than the size of an Ubuntu ISO that I might use to run a VM on OS X. I use OS X, so I use docker-machine to set up a docker daemon. How is Docker able to run an Ubuntu image on OS X with such a small footprint?
The average size of our Docker images were ~300MB - ~600MB. However my new company is using Docker mostly for development workflow, and the average image size is ~1.5GB - ~3GB. Some of the larger images (10GB+) are being actively refactored to reduce the image size.
In the current Docker version, there is a default limitation on the Docker container storage of 10Gb.
A Docker image takes up more space with every layer you add to it. Therefore, the more layers you have, the more space the image requires. Each RUN instruction in a Dockerfile adds a new layer to your image. That is why you should try to do file manipulation inside a single RUN command.
Because usually docker images contains only necessary minimum - in case of ubuntu image, only base system, without GUI (which is rarely used in containers) and without most tools. Ubuntu image actually relatively big - there are much smaller ones.
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