Skip to content

jclee2/gcr-pruner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GCR Pruner

Prunes Google Container Registry images by

  • a) deleting older than DELETE_OLDER_THAN=2020-01-01
  • AND
  • b) keeping only last KEEP_DIGESTS=3 tags

run locally:

PROJECTS="project1 project2" DELETE_OLDER_THAN=2020-01-01 KEEP_DIGESTS=2 GCLOUD_CONCURRENCY=16 app/pruner.sh

or deploy to google cloud run with:

PROJECTS="project1 project2" DELETE_OLDER_THAN=2020-01-01 KEEP_DIGESTS=2 GCLOUD_CONCURRENCY=16 bin/deploy myproject eu.gcr.io/myproject/gcr-pruner europe-north1

and then

$ curl https://gcr-pruner-sztaxlbmya-lz.a.run.app

and schedule with Google Cloud Scheduled Tasks!

Similar to https://github.com/sethvargo/gcr-cleaner and https://gist.github.com/ahmetb/7ce6d741bd5baa194a3fac6b1fec8bb7 but automatically scans & prunes everything!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 91.0%
  • Dockerfile 9.0%