For system, network and cloud administrators

How to view the size of your Docker containers

I came across situations where I needed tot test which Docker image would be most suitable for a particular set of needs and one of those metrics that I used was disk space. I remember the more I used to get started with Docker, the more I was curious to see which Docker images consume more or less resources.

For starters, in order to get an overview of all your disk usage from the Docker images, containers, build cache size and so on, you can use the following command:

docker system df

But if you need a more detailed view, describing every Docker item that takes up resources in each category (volumes, images, etc.), you can just add the -v (verbose) flag to the command above:

docker system df -v
# or docker system df --verbose

You can also use the -s flag to the ps command and get each Docker container’s size:

docker ps -s
# or docker ps --size

Leave a Reply

Your email address will not be published. Required fields are marked *