Created
January 8, 2016 14:00
-
-
Save bahelms/bd63299fd848756a06ab to your computer and use it in GitHub Desktop.
Docker clean up tasks
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
# The grep regex determines what you actually remove | |
# Remove old containers | |
docker ps -a | grep "\(weeks\|hours\) ago" | awk '{print $1}' | xargs docker rm | |
# Remove images without tags | |
docker images | grep "^<none>" | awk '{print $3}' | xargs docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment