0

Checking inside the docker for folder sizes:

bash-5.0# du -hs $(ls -d /*) | grep M
1.5M    /bin
1.2M    /etc
4.0M    /lib
168.5M  /root
636.9M  /usr
1.8M    /var
// about 900M

Checking on my computer for the size of the image:

% docker images
container-name           version              id        37 minutes ago      1.33GB

I'm wondering how can I attribute the missing 400M?

Yaniv Peretz
  • 1,118
  • 2
  • 13
  • 22
  • 1
    A docker image is made up multiple layers. If an intermediate layer contains data that a lower layer deletes, it will still have to be stored somewhere. `docker history` will show you all layers and their sizes. – Generous Badger Aug 03 '21 at 13:54
  • Does this answer your question? [docker container size much greater than actual size](https://stackoverflow.com/questions/31627772/docker-container-size-much-greater-than-actual-size) – Gino Mempin Sep 26 '21 at 08:33

1 Answers1

-1

docker history <image_name> prints the size of each docker layer.

credit to Generous Badger comment.

Yaniv Peretz
  • 1,118
  • 2
  • 13
  • 22