Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Docker OS image size so small?

Tags:

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?

like image 363
deepak Avatar asked May 21 '15 14:05

deepak


People also ask

What is normal Docker image size?

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.

Is there a limit to Docker image size?

In the current Docker version, there is a default limitation on the Docker container storage of 10Gb.

Why are Docker images so big?

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.


1 Answers

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.

like image 137
ISanych Avatar answered Sep 20 '22 03:09

ISanych