· Serhii Siryk · Docker  · 1 min read

Docker: Cleanup all images and containers



Docker: Cleanup all images and containers

While using Docker for active development, you can get into the situation when Docker runs out of disk space and this might be a bit confusing. Besides, Docker command line doesn’t provide a “no brainer” command to start from scratch. Here’s the reference to a github issue regarding the topic.

So, making the long story short, here are few commands you can use for cleaning up your Docker environment:

Stop all containers:

docker kill $(docker ps -q)

Remove all containers:

docker rm $(docker ps -a -q)

Remove all docker images:

docker rmi $(docker images -q)

Warning: This will destroy all your images and containers. It will not be possible to restore them!

Enjoy your day and read more docker articles here!

Back to Blog

Related Posts

View All Posts »