Created
December 17, 2023 23:27
-
-
Save dejaime/f0f088bc0b1d20e4bc2e67b997c2c074 to your computer and use it in GitHub Desktop.
Script to clear docker containers, images and volumes that I need every 6 months or so
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/sh | |
echo "Stopping all containers" | |
docker stop $(docker ps -a -q) || echo "Failed to stop containers, no containers running?"; | |
echo "Pruning system (docker system prune -af)" | |
docker system prune -af | |
echo "Pruning volumes (docker volume prune -af)" | |
docker volume prune -af |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment