GoogleCloudPlatform / gcr-cleaner

Delete untagged image refs in Google Container Registry or Artifact Registry
Apache License 2.0
805 stars 112 forks source link

CI CD examples? #35

Closed yspreen closed 3 years ago

yspreen commented 3 years ago

I think most people collect old images because they push to gcr in a ci cd pipeline. It would be awesome to have minimum examples to run this container in CLI mode for github actions and maybe also travis or gitlab ci

sethvargo commented 3 years ago

You would just run gcr-cleaner-cli -whatever-flags-you-want during your CI step. For container-based systems, you can use the pre-packaged docker containers. The example and flags are heavily dependent on your intended use case.

yspreen commented 3 years ago

I actually found that google's own sdk container works a lot better for this purpose. I compiled a gist here, if anyone's interested: https://gist.github.com/yspreen/fe6bfd7eabeffe82a84f71616ab0cffe

cakeben commented 3 years ago

I have a gitlab ci version of this too

yspreen commented 3 years ago

It's too late for me now, but I think someone stumbling upon the thread might enjoy the link @cakeben :)

cakeben commented 3 years ago

https://github.com/vnc-biz/gcr-scrubber