Jacob Burckhardt
Jacob Burckhardt

Reputation: 513

Minimal Ubuntu docker image is claimed to be 29MB, so why does "docker images" command say 84.1MB?

https://blog.ubuntu.com/2018/07/09/minimal-ubuntu-released

says

The 29MB Docker image for Minimal Ubuntu 18.04 LTS serves as a highly efficient container...

...

On Dockerhub, the new Ubuntu 18.04 LTS image is now the new Minimal Ubuntu 18.04 image. Launching a Docker instance with docker run ubuntu:18.04 therefore launches a Docker instance with the latest Minimal Ubuntu.

I ran the exact command mentioned:

docker run ubuntu:18.04

Then I ran "docker images" which said:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              18.04               16508e5c265d        5 days ago          84.1MB

Why does that output say 84.1MB? The Ubuntu web page I quoted says it should be 29MB.

Am I doing something wrong?

Am I measuring the size incorrectly?

How can I get an Ubuntu image that's only 29MB?

Upvotes: 17

Views: 38400

Answers (1)

trust512
trust512

Reputation: 2254

The article states that Docker Hub hosts a "standard" image, which is bigger than the cloud image. The cloud image is the new thing they introduced and it weighs 29MB while the standard image weighs 32MB.

The cloud image is not available on Docker Hub.

But still, where did the 84MB come from? It's because you are downloading a compressed image from the registry. Which, in this case, only weighs 32MB. Once downloaded, it's decompressed into its usable format and stored locally on your machine.

Meaning everything is in order. Where do you get that cloud image from? Well, I'd start by looking at:

[...] are available for use now in Amazon EC2, Google Compute Engine (GCE) [...]

If you'd like to use it with a private cloud, this is where you download the image from link to Ubuntu Minimal Cloud Images

-edit-

addressing your comment, those private cloud sizes may vary. This is at least partially, if not mostly, due to differences between various hypervisor stacks. As is hinted at in the article:

Cloud images also contain the optimised kernel for each cloud and supporting boot utilities.

--

Just as an update, these days (~three years later), the latest 18:04 image weighs 25MB in its compressed format, so the exact numbers from my original answer are no longer valid, but the point is still valid.

Upvotes: 15

Related Questions