]> code.delx.au - monosys/commitdiff
docker-cleanup: also delete things more than 1 year old
authorJames Bunton <jamesbunton@delx.net.au>
Tue, 23 Jul 2019 11:41:50 +0000 (21:41 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Tue, 23 Jul 2019 11:41:50 +0000 (21:41 +1000)
docker-cleanup

index 45628286092a64ab17cfa7c85c2e0371b0e98dc2..b7c3c6342002000e4d94fff61750952739be32a0 100755 (executable)
@@ -7,7 +7,7 @@ docker container prune -f
 docker volume prune -f
 
 docker images --no-trunc --format '{{.ID}} {{.CreatedSince}}' \
-    | awk '/ months/ { print $1 }' \
+    | awk '/ months/ || / years/ { print $1 }' \
     | xargs --no-run-if-empty docker rmi -f
 
 docker image prune -f