script/cibuild leaves a dangling image on every run #42
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
script/cibuild's main build is an untaggeddocker build ., so each run exports an unreferenced image (naming to moby-dangling@sha256:...). Because the check layer is cache-busted byCHECK_EPOCH, every invocation produces a genuinely new image ID, so these accumulate one per run rather than replacing each other.This got easier to hit when
make cibuildlanded (#34): the CI build is now a one-word command a developer will actually run locally, on a host whose docker storage is shared with other work.script/lintalready avoids exactly this with--output type=cacheonly, so the two entrypoints disagree today.Found during review of #41 and deliberately not fixed there — out of that issue's scope.
Options
script/dockeralready does viascript/projectname, so each run replaces the previous image instead of orphaning it. Keeps an inspectable image.--output type=cacheonly, matchingscript/lint. Cheapest, but leaves nothing to inspect or run — wrong if the point ofcibuildis to produce the CI image.Recommendation: option 1.
cibuildis a build, not just a gate, so it should leave exactly one current image rather than none.Definition of done
script/cibuildno longer accumulates dangling images; demonstrated by counting them across two consecutive runs, not by reasoning.script/lintis either removed or explained.make checkgreen.Constraint
Do not clean up existing dangling images with any global prune. This host's build cache is shared with other sessions and an unscoped prune has already destroyed 41 GB once. Scope any cleanup to images this repo created, by ID.