Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Container Registry images lifecycle

I would like to know if there is a way to setup an objects lifecycle in GCP Container Registry?

I would like to keep the last n versions of an image, automatically deleting the older ones as new ones are pushed online.

I can't work directly on the Cloud Storage bucket because, having multiple images saved, the storage objects are not recognizable.

like image 201
Nicolò Gasparini Avatar asked Mar 15 '26 14:03

Nicolò Gasparini


1 Answers

Seth Vargo, a Google Cloud developer advocate has release GCRCleaner.

Follow the instruction for setting up a scheduler and a Cloud Run for cleaning the GCR.

Edited - (2024-08-12):

The GCRCleaner functionality is now baked in to the GCR Registry itself. It's disclamed in the GCRCleaner homepage, and refers here:

  • https://cloud.google.com/artifact-registry/docs/repositories/cleanup-policy
like image 78
guillaume blaquiere Avatar answered Mar 17 '26 04:03

guillaume blaquiere



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!