Last active
March 14, 2018 06:11
-
-
Save avi-beetul/16be00237677ec29abbbea412862c64f to your computer and use it in GitHub Desktop.
Docker cleanup
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 | |
| echo -e "-- Removing exited containers --\n" | |
| sudo docker rm $(sudo docker ps -q -f status=exited) | |
| echo -e "\n\n-- Removing untagged images --\n" | |
| sudo docker rmi $(sudo docker images -a -q) | |
| echo -e "\n\n-- Removing all dangling volumes --\n" | |
| sudo docker volume rm $(sudo docker volume ls -qf dangling=true) | |
| echo -e "\n\n-- Remove all unused networks --\n" | |
| sudo docker network prune | |
| echo -e "\n\nDone :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment