Repository navigation
ci: add a workflow to cleanup unused manifests - #12362
Merged
Merged
Conversation
- v3 and 4.0.0-beta.420.x do not follow semantic versioning, KEEP_TAG_EXCEPTIONS keeps them explicitly
- with a run every hour and 200 deletions per run the about 35,000 unused manifests on ghcr.io and docker.io are deleted in about 7 days, then the schedule goes back to every 2 weeks or every month - a run deletes 200 at most, as GitHub allows an account 500 requests per hour and the ghrc.io PAT is an account level PAT
- docker_hub is undefined for a manifest ghcr.io has, as a HEAD on docker.io for every one of them could trigger rate limits
- ghcr.io lists deleted versions for 30 days, a HEAD on docker.io for each would reach thousands per run, which could trigger rate limits - twice the delete limit covers the last two runs, and manifests only docker.io has sort first, so a copy docker.io refused is deleted within two runs
- a manually triggered first run in CI uploads the full list of manifests to delete - a later pull request makes the workflow hourly again
- a build pushes its images before the index that tags them, a run in between would see them as unused - a push while the run reads the pages of versions shows one version twice, the list keeps it once so the second delete does not stop the run
- passes the Docker Hub login to curl on stdin, which keeps it out of the process list - checks the format of version ids and digests before a delete
peaklabs-dev
force-pushed
the
ci/clean-unused-images
branch
from
October 30, 2026 22:03
dc1dcbb to
fb0210f
Compare
peaklabs-dev
marked this pull request as ready for review
October 30, 2026 22:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a script that deletes the unused manifests of the Coolify image on ghcr.io and docker.io, and a workflow that only lists them for now.
Changes
scripts/clean-manifests.sh, which lists the unused manifests and deletes as many as--delete <count>asks forlatest,preview,main,nightly, every version tag, every git tag, thepr-*tags of open pull requests, the nightlies of the last 14 days,v3and the4.0.0-beta.420.xversions, and every index, image and attestation they point at--delete, and uploads the list of manifests to delete as an artifact for 90 dayscleanupenvironment, which onlymaincan use and which will later need a maintainer's approval before a run can read themWhy
ghcr.io and docker.io hold 36,660 manifests that no kept tag needs: 13,716 indexes, 18,362 images and 4,582 attestations. They are the per-platform indexes of the old release workflows,
next,sha-*and branch builds, old nightlies and the images of closed pull requests. Deleting them frees 1.6 TB on ghcr.io, from 1.8 TB down to 138.8 GB.The dry run lists all of them for review.