Last active
August 18, 2019 01:21
-
-
Save acoshift/bb1db12539ffd0ac8ed0cbf520ec19ac to your computer and use it in GitHub Desktop.
Delete GCR old images (> 10)
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
gcloud container images list-tags --format=json gcr.io/$PROJECT_ID/$IMAGE | \ | |
jq -r '.[].digest' | \ | |
awk 'NR > 10 {print "gcr.io/$PROJECT_ID/$IMAGE@" $1}' | \ | |
xargs -P 10 -n 10 gcloud container images delete -q --force-delete-tags | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment