Last active
December 10, 2020 05:48
-
-
Save swateek/2a5e0ab650ad597bcc8532a0c6f05783 to your computer and use it in GitHub Desktop.
clean Docker Images with <none> and stopped containers
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
# Clean unused dockers in repo, which are named as <none> | |
docker rmi -f `docker images | grep none | awk '{ print $3 }'` | |
docker rm `docker ps -a | awk '{ print $1 }'` |
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
# Unnamed docker volumes are of Kind: | |
# | |
# fc0e85fbeda7e573d15304e848526e91031e8add01d2f85db8bc96a16d9a822e | |
# fd7b55f16847ea150469cf877aacdfe2573bbd9be527d8ea90e2407c9d345aca | |
# fdf3877a8ba94788652af2515f9c1d24fc6673b86f70d6c344eeb563c7a830a5 | |
docker volume rm `docker volume ls | awk '{ print $2 }' | awk 'length($0) > 30'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment