Created
October 8, 2018 16:40
-
-
Save travis-g/a8d6911034472cdcad7d5b2a1c9976ff to your computer and use it in GitHub Desktop.
Docker cleanup script
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
#!/usr/bin/env sh | |
# Removes stopped containers and dangling/untagged images. | |
# 0 0 * * * docker-clean.sh | |
docker rm $(docker ps -a -q) | |
docker rmi $(docker images | grep "^<none>" | awk '{print $3}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment