-
-
Save gobinathm/cbac750ec199030a0fddba81d24103ee to your computer and use it in GitHub Desktop.
Destroy all Docker Containers and Images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop all containers | |
sudo docker stop $(sudo docker ps -a -q) | |
# Delete all containers | |
sudo docker rm $(sudo docker ps -a -q) | |
# Delete all images | |
sudo docker rmi $(sudo docker images -q) | |
# Deleta all volumes | |
sudo docker volume prune -f | |
# Delete docker networks | |
sudo docker network prune -f | |
# Deleta other resources | |
sudo docker system prune -a -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment