From cd4f992a29da96b835c14545a0cb05e7e87ca291 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 10 Sep 2026 21:02:49 +0200 Subject: image-builder: add safe registry GC and stop OCI-index breakage The registry never reclaims blobs, so its store grows until the disk fills and the nightly builds fail with "no space left on device". Add registry-gc.sh, run weekly (Sunday 08:00), plus a daily dangling-image prune. registry-gc.sh refuses to run while a build is active, stops the registry for a stable blob graph, deletes only untagged manifests (-m) and their blobs, restarts via an EXIT trap, and verifies a tag still pulls. distribution 2.8.x GC does not follow OCI image indexes, so -m deletes their child manifests (distribution#3178). Default BuildKit provenance made every pushed tag an OCI index, which made -m destructive. Build scripts now pass --provenance=false (plain schema2), and registry-gc.sh refuses to run if any tag is still an index. --- image-builder/build-sbo-testbuild.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'image-builder/build-sbo-testbuild.sh') diff --git a/image-builder/build-sbo-testbuild.sh b/image-builder/build-sbo-testbuild.sh index f982a91..8d08a03 100755 --- a/image-builder/build-sbo-testbuild.sh +++ b/image-builder/build-sbo-testbuild.sh @@ -116,7 +116,11 @@ LABEL ${PKGS_LABEL}="${PKGS_HASH}" CMD ["/bin/bash"] DOCKERFILE - local BUILD_FLAGS=() + # --provenance=false keeps the pushed manifest a plain Docker schema2 + # manifest rather than an OCI image index. The registry's garbage collector + # (distribution 2.8.x) does not follow OCI indexes and, with -m, deletes + # their child manifests; schema2 avoids that. See registry-gc.sh. + local BUILD_FLAGS=(--provenance=false) [[ "${FORCE}" == "true" ]] && BUILD_FLAGS+=(--no-cache) # Explicit exit checks: build_variant runs in an `if ! (...)` condition # (see Main), which suppresses `set -e` in this subshell, so a failed build -- cgit v1.2.3