By Bobby Iliev
With the docker system df
command you would get a summary of your Docker usage including things like:
However, here’s how to check the size of each running container
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
By default, if you run docker images
you will get the size of each image. However, if you run docker ps
you would not get the size of the running containers.
To check the size of each running container what you could do is just use the --size
argument of docker ps
command.
- docker ps --size
You would get the following output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE
d64a8112d00a nginx "nginx -g 'daemon of…" About an hour ago Up About an hour 0.0.0.0:80->80/tcp nginx 12MB (virtual 127MB)
ab81be326c31 eboraas/laravel "/usr/sbin/apache2ct…" 2 hours ago Up 2 hours 80/tcp, 443/tcp laravel 92MB (virtual 509MB)
That way you will be able to quickly tell which container exactly is consuming the most disk space.
In case that you need to clear some space, I would recommend checking out this tutorial here on how to remove Docker Images, Containers and Volumes:
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
Hope that this helps!
This comment has been deleted
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.