1. Stop all containers
docker stop $(docker ps -q)
2. Delete all containers
docker rm $(docker ps -aq)
3. Delete all mirrors
docker rmi `docker images -q`
or
docker rmi $(docker images -q)
There may be unclean deleted, plus -f
docker rmi $(docker images -q) -f
Note:
1️⃣If you simply delete the container, you need to stop the container first, and then delete it in rm;
2️⃣If you need to delete the image, you need to stop and delete the container before you can start to delete the image;