Created
April 13, 2024 17:11
-
-
Save mariogarcia-ar/f964d107264bad3408d6fafd8aa9e93f to your computer and use it in GitHub Desktop.
This file contains 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 running containers | |
echo "Stopping all running containers..." | |
docker stop $(docker ps -a -q) | |
# Remove all containers | |
echo "Removing all containers..." | |
docker rm $(docker ps -a -q) | |
# Remove all images | |
echo "Removing all images..." | |
docker rmi $(docker images -a -q) | |
# Remove all volumes | |
echo "Removing all volumes..." | |
docker volume rm $(docker volume ls -q) | |
# Remove all networks | |
echo "Removing all networks..." | |
docker network rm $(docker network ls -q) | |
# System prune to remove any unused data | |
echo "Performing system prune..." | |
docker system prune -af |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment