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.

#!/bin/bash
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -q)

Try it at your own risk!

Author: admin

A software engineer in greater Seattle area

Leave a Reply

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