/ docker

Show Disk Space Used by Docker

Docker is a great tool, and I can't imagine myself managing my servers without it anymore.

But if you are not careful, disk space can be a concern.

docker system df will show you how much disk space is used and with -v flag (verbose), you can see the unique image size for each image.

# docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              17                  16                  3.583GB             582.8MB (16%)
Containers          37                  37                  6.162MB             0B (0%)
Local Volumes       16                  16                  33B                 0B (0%)
Build Cache                                                 0B                  0B

As you can see I have 17 images but only 16 are active, with a total of 582.8Mb reclaimable.

Run docker image ls and I can see that it is an older version of my ghost blog, so a docker system prune -a and problem solved.

One more thing, docker system prune -a don't remove dangling volumes, for that you need to run docker volume rm $(docker volume ls -q --filter dangling=true)

Show Disk Space Used by Docker
Share this

Subscribe to Tiago Rodrigues