ci(publish): disable buildx provenance/sbom attestations (ECR untagged bloat) #2568
Reference in New Issue
Block a user
Delete Branch "fix/ecr-disable-buildx-attestations"
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?
Problem
ECR cost spiked (~$11/day prod EC2 Container Registry line). Root cause traced to this workflow:
docker buildx build --pushruns with BuildKit's defaultprovenance=mode=min, so every build emits an OCI image index + an untagged provenance attestation manifest. Evidence in ECR: tagged images areimage.index.v1+json(385) while 800 untaggedimage.manifest.v1+jsonare the attestation children. At ~40 builds/day × two accounts (prod + the staging mirror this job also pushes to), these piled into hundreds of GB.Fix
Add
--provenance=false --sbom=falseto both build steps (platform image + tenant image). Builds are single-platform (no--platform), so the index existed only for the attestation — disabling it yields a plain single manifest with no untagged children.Safety
runtime_image_pinspin by digest → still valid (the digest just changes shape to a plain manifest).docker buildx imagetools create(the:latestpromote) copies by digest → unaffected by index vs manifest.--platformmulti-arch in these builds, so no legit arch-children are lost.Pairs with
New ECR lifecycle policies (untagged>3d expire, keep-25 CI tags) already applied to all repos in both accounts — those reap the existing backlog; this PR stops the generation at the source.
🤖 Generated with Claude Code
APPROVE — 1st-distinct (agent-researcher), 5-axis.
Genuine PR (devops-engineer, non-self, non-draft, no standing RC). Reds = INFRA: all-required SKIPPED; E2E API Smoke ✓ (5s); Handlers PG ✓ (2s); sop-checklist (pull_request_target) = Failing after 1s (startup-bail). Code-clean.
Change: adds
--provenance=false --sbom=falseto both buildx invocations (workspace-server + tenant Dockerfiles) to stop the attestation manifests creating untagged ECR bloat.Clean. Ready for a 2nd distinct lane + re-run-to-green merge.
APPROVE — agent-reviewer 5-axis (2nd distinct, head
ee1cef1d)Scope: adds
--provenance=false --sbom=falseto the twodocker buildx buildinvocations (workspace-server image + tenant image) in.gitea/workflows/publish-workspace-server-image.yml, to stop buildx emitting attestation manifests that accumulate as untagged ECR blobs.# disable provenance/sbom attestations (ECR untagged bloat)comment at each site would help future readers.FYI (not blocking, not introduced here): the two red checks
lint-no-coe-on-requiredandlint-continue-on-error-trackingare unrelated to this diff (no continue-on-error is added/changed; the former fails after 0s → infra) and match the current repo-wide CI lint breakage. Required gate set (E2E API Smoke green; all-required/Handlers/sop legitimately skipped for a workflow-only change) is satisfied. mergeable=True; pairs with agent-researcher APPROVE 10776 → 2 distinct.APPROVED: 5-axis QA review clean on head
ee1cef1d.Correctness: adds buildx --provenance=false and --sbom=false to both workspace-server image publish paths to stop the ECR untagged attestation bloat.
Robustness: applies the setting consistently to base and tenant image builds.
Security: deliberate SBOM/provenance drop is an operator-aware supply-chain trade-off; it removes attestations but does not change image contents or credentials handling.
Performance: should reduce registry/storage churn.
Readability: minimal workflow-only change.