Keep your container registry clean without manual work. A scheduled job scans images, removes old tags you do not need, runs garbage collection, and emails a summary. Teams that run private registries can cut storage costs and avoid disk full issues.
Each night the schedule starts at 1 AM. The flow lists all repositories from the registry catalog, then loads tags for every image. It splits and filters tags, sorts by creation time, and groups tags by image. It fetches manifest digests and deletes only the tags that do not match your rules, like keeping latest and the most recent builds. After deletions, it connects over SSH to run the garbage collection command on the host. Email notices confirm removals, and a separate email reports any failure. It supports Docker and OCI image formats using proper Accept headers.
Setup needs a registry URL, a user with delete rights, SMTP details for email, and SSH access to the registry server. You can change the retention logic in the Identify Tags to Remove code so it keeps the tags you want. Plan a short test window and review the email summary to confirm which tags were removed. Expect faster cleanups, lower storage use, and fewer urgent fixes when servers run low on space.