Description
When pushing new docker images for an existing tag, the old image still exists and uses up storage one the server. While you can use images just by pointing to their sha, I've yet to find someone who actively uses that. For my own registry (portus) I have a cron job to automatically remove everything that does not have a tag pointing to it. Docker even has a command for this.
Having a cleanup job like that would allow to keep old versions but still solve the storage space problem.
No, only if it's "older than" or not included in the "keep pattern". But it should be no problem to add a special logic here because there is already the custom
Version == "latest"
for containers.
Gitlab has an automatic garbage collection process for this: https://docs.gitlab.com/ee/administration/packages/container_registry.html#removing-untagged-manifests-and-unreferenced-layers
I think it's best to discuss this before implementing, mostly regarding these open questions:
- Should this be enabled automatically?
- Should this be a repo/org setting or a global config one?