Skip to content

[ci] Enable OCI media types for container image attestations - #6629

Merged
reinhapa merged 2 commits into
eXist-db:developfrom
line-o:ci-oci-mediatypes-attestations
Aug 11, 2026
Merged

[ci] Enable OCI media types for container image attestations#6629
reinhapa merged 2 commits into
eXist-db:developfrom
line-o:ci-oci-mediatypes-attestations

Conversation

@line-o

@line-o line-o commented Aug 10, 2026

Copy link
Copy Markdown
Member

Description:

The published existdb/existdb image on Docker Hub carries valid SBOM (SPDX) and provenance (SLSA) attestations in its OCI index, but Docker Hub / Docker Scout report them as missing. Root cause: Scout discovers attestations via the OCI 1.1 Referrers API, which requires the attestation manifest to carry a subject descriptor pointing back to the image manifest it describes. BuildKit only emits that subject field (as an "OCI artifact" attestation) when the image itself is pushed with OCI media types — our docker/build-push-action steps didn't request that.

This PR adds oci-mediatypes=true to the outputs of both staging build/push steps (main + DEBUG), alongside the existing push=true.

What Changed:

  • .github/workflows/ci-container.yml: replaced push: true with outputs: type=image,oci-mediatypes=true,push=true on the "Build & push staging image (main)" and "Build & push staging image (DEBUG)" steps.

Reference:

  • moby/buildkit#6171 — "Enable OCI artifact for attestation manifest by default", fixed in BuildKit v0.32.0+, conditional on OCI media types being enabled for the image output.
  • BuildKit attestation storage docs — confirms the index-level vnd.docker.reference.type: attestation-manifest annotation (which this workflow's own "Verify published manifest" step checks) is unchanged by this switch, so no other workflow changes are needed.

Type of tests:

No new tests added — this is CI publish-pipeline configuration. Verification: this workflow's own "Verify published manifest (arch + attestations)" step already asserts attestation manifests are present; once merged, confirm on the next develop publish run that Docker Hub / docker scout policy existdb/existdb:latest shows the SBOM and provenance requirements as satisfied rather than "Missing".

Docker Hub/Scout only discovers SBOM and provenance attestations via
the OCI 1.1 Referrers API. BuildKit >=0.32 defaults to publishing
attestations as OCI artifacts (with a subject descriptor Referrers
lookups need) only when the image itself is pushed with OCI media
types, which these steps weren't requesting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@line-o
line-o requested a review from a team as a code owner August 10, 2026 12:13
@line-o
line-o requested a review from a team August 10, 2026 17:28
@line-o

line-o commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Would one of you merge, @dizzzz @reinhapa ?

Don't rely on BuildKit's implicit oci-artifact default (only enabled
when oci-mediatypes=true, and only on BuildKit >=0.32) — request the
subject-bearing attestation format directly so this doesn't silently
regress to the legacy format on an older builder.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@line-o

line-o commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Update: switched from relying on BuildKit's implicit `oci-artifact` default to setting it explicitly.

Per the image/registry exporter docs, `oci-artifact` ("Format attestations as OCI artifacts") is a directly settable attribute — no need to depend on BuildKit's version-gated default (only auto-enabled when `oci-mediatypes=true` on BuildKit ≥0.32, per moby/buildkit#6914). Setting it explicitly (`outputs: type=image,oci-mediatypes=true,oci-artifact=true,push=true`) makes the attestation format independent of the runner's BuildKit version.

(Also worth noting for anyone comparing against the buildx build docs: `--output type=oci` is a local tarball export, not a registry push mechanism — the relevant flags here belong to `type=image`/`type=registry` instead.)

@reinhapa
reinhapa merged commit 1b7dcbb into eXist-db:develop Aug 11, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants