DEV Community

Viral Patel
Viral Patel

Posted on

Docker Cleanup Commands

If you see Docker claiming lot of space on your computer and if you want to reclaim all of your space back from Docker, use following Docker commands for cleanup. Make sure you are aware that this will delete images and containers from your machine, make sure you do not run this on production machines unless you know what you are doing 😎.

How to remove docker’s unused data?

docker system prune —force

To delete everything

docker system prune -a --volumes

How to delete all docker containers including its volumes use?

docker rm -vf $(docker ps -a -q)

How to delete all docker images?

docker rmi -f $(docker images -a -q)

These commands helped me to reclaim more than 10GB of data for only few months of work with Docker.

This blog was originally published on my personal blog Viral Patel.

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay