Remove All Containers and Images

What if you want to remove all the containers and images from your Docker host where you are just experimenting? Here is a convenient (and also could be dangerous) script.

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

Try it at your own risk!

Leave a Reply

Your email address will not be published.