Enable OCI artifact for attestation manifest by default
https://github.com/moby/buildkit/pull/5573 adds opt-in to enable OCI artifact for pushed attestations. We should enable OCI artifact for attestations by default. It would be done by default if image output is OCI. We should also probably consider defaulting to OCI mediatypes which is currently being worked on in https://github.com/moby/buildkit/pull/6095.
Support across registries
| Registry | Supported | Notes |
|---|---|---|
| AWS Elastic Container Registry (ECR) | 🟢 | Fixed since v0.25.0 https://github.com/moby/buildkit/pull/6191 |
| Azure Container Registry (ACR) | 🟢 | |
| Distribution | 🟢 | |
| Docker Hub | 🟢 | |
| GitHub Container Registry (GHCR) | 🟢 | https://oci.dag.dev/?image=ghcr.io%2Fdocker-ghactiontest%2Ftest%3Aci-oci-artifact |
| GitLab | 🔴 | Can't push: unknown: manifest invalid - unknown media type: application/vnd.docker.attestation.manifest.v1+json ; Tracked in https://gitlab.com/gitlab-org/container-registry/-/issues/1679 |
| Google Artifact Registry (GAR) | 🟢 | |
| Harbor | 🟢 | |
| JFrog Artifactory | 🟢 | |
| Sonatype Nexus | 🟢 | |
| Red Hat Quay | 🟢 | https://oci.dag.dev/?image=quay.io%2Fdocker_build_team%2Fghactiontest%3Aci-oci-artifact |
We need a coverage report for common registries to make sure this doesn't cause breakage.
Yes I think we could have table similar to https://github.com/moby/buildkit/issues/2251. I will update this issue.
Updated issue description with table of support across registries.
Can't push on AWS ECR: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565117#step:11:402
...
#40 exporting to image
#40 exporting layers done
#40 preparing layers for inline cache 0.0s done
#40 exporting manifest sha256:d66a3ac05040834ebbadcecb9b85c6339da28ec7ecede75185966274cd0ba710 done
#40 exporting config sha256:c2d8d3567345b5db9610fa7583292c5aed55342e8d2d3619e4052c6e70059b57 done
#40 exporting attestation manifest sha256:9d0ce7949a191967dbc84584d45059d6a2b02904df85264e99eab6042df3c1e1 done
#40 exporting manifest sha256:be12ccba1d5b957541aa8792ffa1e01e27ee66d9fd86aaadd735eeeb79d6b02f done
#40 exporting config sha256:77a5669f995a59ac14f582c9d0ccdadaa02adf3dab0914f0e3f57179e33239fd done
#40 exporting attestation manifest sha256:5bb4fa6899e233db2156ed6e68482afb74de5e3f595181ea9d7e0e1db3af123e done
#40 exporting manifest sha256:662fd1c91ba544a74e54a334276c59a0f3fbfa5f46d571fc4ecd8e34cd482d10 done
#40 exporting config sha256:9278296418b133144bc00154bc953b6a21d2a99b457703d5f076a865b7bc8a22 done
#40 exporting attestation manifest sha256:ad78eddb2aeb52b13b5337022157fcac55735682e200cdc05c1ddc87b9e3c483 done
#40 exporting manifest sha256:8952f965aa3525dff6198d44713a4ca4d9e1d5867a3d03d47509bb67ed8aa72e done
#40 exporting config sha256:3bd336233faff5c89c143f3ead26655e91af2fe9903c8bb842efb4112609688f done
#40 exporting attestation manifest sha256:a4d93a94bdfcf0d0058dce40e314d1721aa2c17346db889c107979aba1dee6ca done
#40 exporting manifest sha256:d06ca22b0dd34da5edc320637dc9752ded7f08fba513bb4f045f8c10f4f69afd done
#40 exporting config sha256:3f7fc562b069bce848e73fadd6f674a519fc1d141cdee64157155da20e0c78f1 done
#40 exporting attestation manifest sha256:c690223d20859e235713edde84a540d78fd16a8904becb97a3710bd747715bb9 done
#40 exporting manifest sha256:26b013b8d42d5f8bc2dbcc28fb4cd31858ac21edb4c1bb0056c437ca81772af9 done
#40 exporting config sha256:880d16ba69f98cca711771e0e385451468e0176316f92a897b32b756585bc701 done
#40 exporting attestation manifest sha256:b9bd054c58d2c108fcb293cb4baa19dfef29219a9698e7e9125584b114361334 done
#40 exporting manifest sha256:f14f267f2325b99104f89c7329cc4684ede12dbdc3c24d7c788e992149ad675a done
#40 exporting config sha256:813bbbc2ec48be0048f9a29f49bbc82a674de97433758874a7b7611709721600 done
#40 exporting attestation manifest sha256:203f1d9841a0a3927708f57d79e76b1d193a9230df481da17cce4083a4e1c7a5 done
#40 exporting manifest list sha256:34debb89fc0266a3d45c6bb9822d84422b239ca8b74f99f05675d299e560c655 done
#40 pushing layers
#40 pushing layers 2.1s done
#40 pushing manifest for ***.dkr.ecr.***.amazonaws.com/sandbox/test-docker-action:ci-oci-artifact@sha256:34debb89fc0266a3d45c6bb9822d84422b239ca8b74f99f05675d299e560c655
#40 pushing manifest for ***.dkr.ecr.***.amazonaws.com/sandbox/test-docker-action:ci-oci-artifact@sha256:34debb89fc0266a3d45c6bb9822d84422b239ca8b74f99f05675d299e560c655 0.2s done
#40 ERROR: failed to push ***.dkr.ecr.***.amazonaws.com/sandbox/test-docker-action:ci-oci-artifact: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'
BuildKit logs: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565117#step:24:555
time="2025-08-29T15:57:41Z" level=debug msg="fetch response received" response.header.content-length=137 response.header.content-type="application/json; charset=utf-8" response.header.date="Fri, 29 Aug 2025 15:57:41 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.sizes=935.000000 response.status="405 Method Not Allowed" span="exporting to image" spanID=83883544d8e6a2ed traceID=ea6374e46e25e2d89d73fe4f9e4f0327
time="2025-08-29T15:57:41Z" level=debug msg="unexpected response" error="unexpected status from PUT request to https://***.dkr.ecr.***.amazonaws.com/v2/sandbox/test-docker-action/manifests/sha256:a4d93a94bdfcf0d0058dce40e314d1721aa2c17346db889c107979aba1dee6ca: 405 Method Not Allowed\nunsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'" span="exporting to image" spanID=83883544d8e6a2ed traceID=ea6374e46e25e2d89d73fe4f9e4f0327
time="2025-08-29T15:57:41Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = failed to push ***.dkr.ecr.***.amazonaws.com/sandbox/test-docker-action:ci-oci-artifact: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'" spanID=b723d4f4540aaf3c traceID=ea6374e46e25e2d89d73fe4f9e4f0327
failed to push ***.dkr.ecr.***.amazonaws.com/sandbox/test-docker-action:ci-oci-artifact: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'
Same on GitLab: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565104#step:11:404
#40 exporting to image
#40 exporting layers done
#40 preparing layers for inline cache 0.0s done
#40 exporting manifest sha256:152bdd997f13c48212688914f90b5b89b0d5715c721c9f78a34d730d9b910ec9 done
#40 exporting config sha256:c0d247cc1dd78b5e7519227047e34d8db04c7436b1fe92a7db9ca8b41e041faa done
#40 exporting attestation manifest sha256:7506c06eacc943133f08f94950d929c3a79f3b75a13c68a69ae42fd39e6ac2c5 done
#40 exporting manifest sha256:ef4f2d778582b580ae948f7fe8d5ef56fff18ea36ab3a8dd6081c38d9a1e80ff done
#40 exporting config sha256:04f459071786764d2117b613927b3ae6cdd4bf3ce491486d57411be9c68cd536 done
#40 exporting attestation manifest sha256:ec7da51cca1b6a2d7d5a739bb42664faee93b480725db0b1b4b9597968f0fe67 done
#40 exporting manifest sha256:1bca921233a4390007d7615e38759dea25a4634579657d3338701917e03c5dc5 done
#40 exporting config sha256:6bf6499016edd664fb23c68e86165ff18ad3725f775929699732b31f20efb0f6 done
#40 exporting attestation manifest sha256:dcf9fa3c087246aef39131516e0350cd35adf144f2cf5b90f3eed4cad69896bc done
#40 exporting manifest sha256:3c983e1bd99140d42eaa2a9f17cc91a4feec1d13e0e42e2a98d9f6886082f966 done
#40 exporting config sha256:fd8fda9d02c4ab54db5732f6b0e07186b7c70c3fe42520b96dffc554df3a8c66 done
#40 exporting attestation manifest sha256:a8a9bb4dc833f520367fbdae01d08f9cf67b368a418a6da6495ddd5277fec04f done
#40 exporting manifest sha256:7aa67fb36d581028fd1f268720344d06ac9a097fe4bf1a5c82b764622b3b83fc done
#40 exporting config sha256:1cac4cb2651a7d0302db3da8cf58ed44c5bb927828c78e877d182a7226d4268a done
#40 exporting attestation manifest sha256:1cddffadfbfbce206b6e2722ca5ae3c3fe0283ee79789260b4464f800bf8dd96 done
#40 exporting manifest sha256:b894f7e19d3eae01907ddb3ac3d40a82b19232bb38d72ea8484238a2fdf5acdb done
#40 exporting config sha256:f0a7f226f857f36ddc36e8de4d976b720aff6d6cc3d9f32d3bf2db35318ea952 done
#40 exporting attestation manifest sha256:c5f0d3400e846730437d198b9866f877041df8703ab27be44d78a02eabcd7d8c done
#40 exporting manifest sha256:99a6193c2229cc0c507edf2591f3d493ded242b5977df876051a1bd6e8fdf631 done
#40 exporting config sha256:3aa9e02fa3e01f50e966c98298cdad3fa4864b50845dea5d2cc11e03789ff7ae done
#40 exporting attestation manifest sha256:02be02628960137db7df2d0bff66d678279f37b43fc4b9f1cdc62d29142e86a3 done
#40 exporting manifest list sha256:eca786f13a57db37f7e6f61f715c9db78dd31f0ff978c69e0694e3e3d566a558 done
#40 ...
#41 [auth] test1716/test:pull,push token for registry.gitlab.com
#41 DONE 0.0s
#40 exporting to image
#40 pushing layers
#40 pushing layers 6.0s done
#40 pushing manifest for registry.gitlab.com/test1716/test:ci-oci-artifact@sha256:eca786f13a57db37f7e6f61f715c9db78dd31f0ff978c69e0694e3e3d566a558
#40 pushing manifest for registry.gitlab.com/test1716/test:ci-oci-artifact@sha256:eca786f13a57db37f7e6f61f715c9db78dd31f0ff978c69e0694e3e3d566a558 0.0s done
#40 ERROR: failed to push registry.gitlab.com/test1716/test:ci-oci-artifact: unknown: blob unknown to registry - sha256:7aa67fb36d581028fd1f268720344d06ac9a097fe4bf1a5c82b764622b3b83fc
BuildKit logs: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565104#step:24:555
time="2025-08-29T15:57:39Z" level=debug msg="checking and pushing to" span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642 url="https://registry.gitlab.com/v2/test1716/test/manifests/sha256:1cddffadfbfbce206b6e2722ca5ae3c3fe0283ee79789260b4464f800bf8dd96"
time="2025-08-29T15:57:39Z" level=debug msg="do request" request.header.accept="application/vnd.oci.image.manifest.v1+json, */*" request.header.user-agent=buildkit/v0.23 request.method=HEAD span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642
time="2025-08-29T15:57:39Z" level=debug msg="fetch response received" response.header.content-length=189 response.header.content-type=application/json response.header.date="Fri, 29 Aug 2025 15:57:39 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.gitlab-lb=haproxy-registry-01-lb-gprd response.header.gitlab-sv=registry-us-east1-b response.header.x-content-type-options=nosniff response.status="404 Not Found" span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642
time="2025-08-29T15:57:39Z" level=debug msg="do request" request.header.content-type=application/vnd.oci.image.manifest.v1+json request.header.user-agent=buildkit/v0.23 request.method=PUT span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642
time="2025-08-29T15:57:39Z" level=debug msg="fetch response received" response.header.content-length=166 response.header.content-type=application/json response.header.date="Fri, 29 Aug 2025 15:57:39 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.gitlab-lb=haproxy-registry-01-lb-gprd response.header.gitlab-sv=registry-us-east1-b response.header.x-content-type-options=nosniff response.status="400 Bad Request" span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642
time="2025-08-29T15:57:39Z" level=debug msg="unexpected response" error="unexpected status from PUT request to https://registry.gitlab.com/v2/test1716/test/manifests/sha256:1cddffadfbfbce206b6e2722ca5ae3c3fe0283ee79789260b4464f800bf8dd96: 400 Bad Request\nunknown: blob unknown to registry" span="exporting to image" spanID=7852cd8e37bb6088 traceID=aa8517984f21e70ff9cbec3fdabb7642
time="2025-08-29T15:57:39Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = failed to push registry.gitlab.com/test1716/test:ci-oci-artifact: unknown: blob unknown to registry - sha256:7aa67fb36d581028fd1f268720344d06ac9a097fe4bf1a5c82b764622b3b83fc" spanID=de71e42abc1ee122 traceID=aa8517984f21e70ff9cbec3fdabb7642
failed to push registry.gitlab.com/test1716/test:ci-oci-artifact: unknown: blob unknown to registry - sha256:7aa67fb36d581028fd1f268720344d06ac9a097fe4bf1a5c82b764622b3b83fc
Can't push on AWS ECR: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565117#step:11:402
I have created a repo in our sandbox to test this locally and got the same error:
FROM alpine
RUN apk add curl
RUN echo hello
docker buildx --builder builder build --tag public.ecr.aws/q3b5f1u4/buildkit-6171:test --output type=registry,oci-artifact=true,push=true --provenance mode=max .
#0 building with "builder" instance using docker-container driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 81B done
#1 DONE 0.0s
#2 [internal] load metadata for docker.io/library/alpine:latest
#2 DONE 0.4s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [1/3] FROM docker.io/library/alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#4 resolve docker.io/library/alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 0.0s done
#4 DONE 0.0s
#5 [2/3] RUN apk add curl
#5 CACHED
#6 [3/3] RUN echo hello
#6 CACHED
#7 exporting to image
#7 exporting layers done
#7 exporting manifest sha256:11c3b70deec71f320a2cd4674fef481a690a6d2d2a669a13327e2e158d185e01 0.0s done
#7 exporting config sha256:7ac9178e5ce0bbc4c1e0bcda89a87aa6724487ccd269d8c967b1923db67ae57b 0.0s done
#7 exporting attestation manifest sha256:ae9944cd9e60043d62854591ca0b69c785bccc079279cad21bd9180a7469ff0e 0.0s done
#7 exporting manifest list sha256:a5e9a8b5093bb2316720b8d8a7e2871e76b318d757912ef2cd9dc3192ee969c0
#7 exporting manifest list sha256:a5e9a8b5093bb2316720b8d8a7e2871e76b318d757912ef2cd9dc3192ee969c0 0.0s done
#7 pushing layers
#7 ...
#8 [auth] aws:: q3b5f1u4/buildkit-6171:pull,push token for public.ecr.aws
#8 DONE 0.0s
#7 exporting to image
#7 pushing layers 2.8s done
#7 pushing manifest for public.ecr.aws/q3b5f1u4/buildkit-6171:test@sha256:a5e9a8b5093bb2316720b8d8a7e2871e76b318d757912ef2cd9dc3192ee969c0
#7 pushing manifest for public.ecr.aws/q3b5f1u4/buildkit-6171:test@sha256:a5e9a8b5093bb2316720b8d8a7e2871e76b318d757912ef2cd9dc3192ee969c0 1.0s done
#7 ERROR: failed to push public.ecr.aws/q3b5f1u4/buildkit-6171:test: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'
------
> exporting to image:
------
ERROR: failed to build: failed to solve: failed to push public.ecr.aws/q3b5f1u4/buildkit-6171:test: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'
Only the image manifest is pushed: https://oci.dag.dev/?image=public.ecr.aws%2Fq3b5f1u4%2Fbuildkit-6171%40sha256%3A11c3b70deec71f320a2cd4674fef481a690a6d2d2a669a13327e2e158d185e01
Attestation manifest sha256:ae9944cd9e60043d62854591ca0b69c785bccc079279cad21bd9180a7469ff0e cannot be pushed:
time="2025-09-05T10:45:24Z" level=debug msg="fetch response received" response.header.connection=keep-alive response.header.content-length=137 response.header.content-type="application/json; charset=utf-8" response.header.date="Fri, 05 Sep 2025 10:45:25 GMT" response.header.docker-distribution-api-version=registry/2.0 response.status="405 Method Not Allowed" span="exporting to image" spanID=a35c90fa4618e2ae traceID=0d055f1da64374e01564472673a11778
time="2025-09-05T10:45:24Z" level=debug msg="unexpected response" error="unexpected status from PUT request to https://public.ecr.aws/v2/q3b5f1u4/buildkit-6171/manifests/sha256:ae9944cd9e60043d62854591ca0b69c785bccc079279cad21bd9180a7469ff0e: 405 Method Not Allowed\nunsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'" span="exporting to image" spanID=a35c90fa4618e2ae traceID=0d055f1da64374e01564472673a11778
time="2025-09-05T10:45:24Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = failed to push public.ecr.aws/q3b5f1u4/buildkit-6171:test: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'" spanID=37f1ed5f7f664495 traceID=0d055f1da64374e01564472673a11778
failed to push public.ecr.aws/q3b5f1u4/buildkit-6171:test: unsupported: Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'
Attestation manifest looks like this: https://oci.dag.dev/?image=crazymax%2Fbuildkit%40sha256%3A57de294a6ccd02c89ec60c2a7a2e1b67238d3ea4ed89899d3bb8191005bc72c2
{
"schemaVersion":2,
"mediaType":"application/vnd.oci.image.manifest.v1+json",
"artifactType":"application/vnd.docker.attestation.manifest.v1+json",
"config":{
"mediaType":"application/vnd.oci.empty.v1+json",
"digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size":2,
"data":"e30="
},
"layers":[
{
"mediaType":"application/vnd.in-toto+json",
"digest":"sha256:68bca3dca58f009e74deaf3c646dbec31aedd970adc6146c3377401cf957a712",
"size":4351,
"annotations":{
"in-toto.io/predicate-type":"https://slsa.dev/provenance/v0.2"
}
}
],
"subject":{
"mediaType":"application/vnd.oci.image.manifest.v1+json",
"digest":"sha256:11c3b70deec71f320a2cd4674fef481a690a6d2d2a669a13327e2e158d185e01",
"size":860,
"platform":{
"architecture":"amd64",
"os":"linux"
}
}
}
@sudo-bmitch Maybe you have an idea?
For ECR, try removing the platform from the subject. For GitLab, they have an allow list on the media type, not sure if the empty config media type is on that list, or if they also check the artifact media type.
Edit: they may be checking the artifact type https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/supported-media-types.md
Thanks!
For ECR, try removing the platform from the subject.
Indeed seems to work if I remove the platform: https://github.com/moby/buildkit/compare/master...crazy-max:buildkit:oci-artifact-clear-platform?expand=1
$ docker buildx --builder builder build --tag public.ecr.aws/q3b5f1u4/buildkit-6171:test --output type=registry,oci-artifact=true,push=true --provenance mode=max .
#0 building with "builder" instance using docker-container driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 81B done
#1 DONE 0.1s
#2 [internal] load metadata for docker.io/library/alpine:latest
#2 ...
#3 [auth] library/alpine:pull token for registry-1.docker.io
#3 DONE 0.0s
#2 [internal] load metadata for docker.io/library/alpine:latest
#2 DONE 1.3s
#4 [internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s
#5 [1/3] FROM docker.io/library/alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#5 resolve docker.io/library/alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 0.0s done
#5 sha256:9824c27679d3b27c5e1cb00a73adb6f4f8d556994111c12db3c5d61a0c843df8 0B / 3.80MB 0.2s
#5 sha256:9824c27679d3b27c5e1cb00a73adb6f4f8d556994111c12db3c5d61a0c843df8 3.80MB / 3.80MB 0.3s done
#5 extracting sha256:9824c27679d3b27c5e1cb00a73adb6f4f8d556994111c12db3c5d61a0c843df8 0.1s done
#5 DONE 0.4s
#6 [2/3] RUN apk add curl
#6 0.059 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz
#6 0.161 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/community/x86_64/APKINDEX.tar.gz
#6 0.448 (1/9) Installing brotli-libs (1.1.0-r2)
#6 0.468 (2/9) Installing c-ares (1.34.5-r0)
#6 0.479 (3/9) Installing libunistring (1.3-r0)
#6 0.502 (4/9) Installing libidn2 (2.3.7-r0)
#6 0.512 (5/9) Installing nghttp2-libs (1.65.0-r0)
#6 0.522 (6/9) Installing libpsl (0.21.5-r3)
#6 0.530 (7/9) Installing zstd-libs (1.5.7-r0)
#6 0.546 (8/9) Installing libcurl (8.14.1-r1)
#6 0.560 (9/9) Installing curl (8.14.1-r1)
#6 0.578 Executing busybox-1.37.0-r18.trigger
#6 0.583 OK: 12 MiB in 25 packages
#6 DONE 0.7s
#7 [3/3] RUN echo hello
#7 0.089 hello
#7 DONE 0.1s
#8 exporting to image
#8 exporting layers
#8 exporting layers 0.4s done
#8 exporting manifest sha256:6e20a9da341bdbd9feac7f84b6a6073c27d25d3d48cbf16e881c2d163391cc05 0.0s done
#8 exporting config sha256:2c8c828069786d32c716dfacc65b34315c70ddef1fb906c7862e7dd3c9094c18 0.0s done
#8 exporting attestation manifest sha256:b1f2a8735bbfbe62321a82e3aa61cc72149962fd061747b3189264e44c456a9d 0.0s done
#8 exporting manifest list sha256:3f4f0789259cd37d5d00bc0806a7c401d17a9d1a791966fcf7fa1e5a37973cce 0.0s done
#8 pushing layers
#8 ...
#9 [auth] aws:: q3b5f1u4/buildkit-6171:pull,push token for public.ecr.aws
#9 DONE 0.0s
#8 exporting to image
#8 pushing layers 2.7s done
#8 pushing manifest for public.ecr.aws/q3b5f1u4/buildkit-6171:test@sha256:3f4f0789259cd37d5d00bc0806a7c401d17a9d1a791966fcf7fa1e5a37973cce
#8 pushing manifest for public.ecr.aws/q3b5f1u4/buildkit-6171:test@sha256:3f4f0789259cd37d5d00bc0806a7c401d17a9d1a791966fcf7fa1e5a37973cce 1.6s done
#8 DONE 4.7s
- https://oci.dag.dev/?image=public.ecr.aws%2Fq3b5f1u4%2Fbuildkit-6171%3Atest%40sha256%3A3f4f0789259cd37d5d00bc0806a7c401d17a9d1a791966fcf7fa1e5a37973cce
- https://oci.dag.dev/?image=public.ecr.aws/q3b5f1u4/buildkit-6171@sha256:b1f2a8735bbfbe62321a82e3aa61cc72149962fd061747b3189264e44c456a9d&mt=application%2Fvnd.oci.image.manifest.v1%2Bjson&size=838
{
"schemaVersion":2,
"mediaType":"application/vnd.oci.image.manifest.v1+json",
"artifactType":"application/vnd.docker.attestation.manifest.v1+json",
"config":{
"mediaType":"application/vnd.oci.empty.v1+json",
"digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size":2,
"data":"e30="
},
"layers":[
{
"mediaType":"application/vnd.in-toto+json",
"digest":"sha256:64e5c4268afb01b1f365b765584db623f5cb58804b5c49394eb097f8daa97ad6",
"size":4371,
"annotations":{
"in-toto.io/predicate-type":"https://slsa.dev/provenance/v0.2"
}
}
],
"subject":{
"mediaType":"application/vnd.oci.image.manifest.v1+json",
"digest":"sha256:6e20a9da341bdbd9feac7f84b6a6073c27d25d3d48cbf16e881c2d163391cc05",
"size":860
}
}
But it should work with the platform field as the subject specifies a descriptor right?: https://github.com/opencontainers/image-spec/blob/v1.1.1/manifest.md#image-manifest-property-descriptions
This OPTIONAL property specifies a descriptor of another manifest. This value defines a weak association to a separate Merkle Directed Acyclic Graph (DAG) structure, and is used by the referrers API to include this manifest in the list of responses for the subject digest.
For GitLab, they have an allow list on the media type, not sure if the empty config media type is on that list, or if they also check the artifact media type.
Edit: they may be checking the artifact type https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/supported-media-types.md
Hum yeah looks like it. I guess we need to request our media type application/vnd.docker.attestation.manifest.v1+json to be added to their database. We should probably document that in https://github.com/moby/buildkit/blob/master/docs/attestations/attestation-storage.md.
Hum yeah looks like it. I guess we need to request our media type
application/vnd.docker.attestation.manifest.v1+jsonto be added to their database. We should probably document that in https://github.com/moby/buildkit/blob/master/docs/attestations/attestation-storage.md.
Opened https://gitlab.com/gitlab-org/container-registry/-/issues/1679
But it should work with the platform field as the subject specifies a descriptor right?
It's a descriptor, and in an index the manifests there typically include a platform. But we haven't defined a behavior for the platform in other descriptors like the subject or layer listing. Two different tools may decide to generate and consume that in incompatible ways.
ECR takes a strict parsing of the manifest for security reasons. Most others follow the extensibility guidance and ignore unknown fields in the JSON, which gives them forward compatibility as new fields are added.
Hum yeah looks like it. I guess we need to request our media type
application/vnd.docker.attestation.manifest.v1+jsonto be added to their database. We should probably document that in https://github.com/moby/buildkit/blob/master/docs/attestations/attestation-storage.md.Opened https://gitlab.com/gitlab-org/container-registry/-/issues/1679
Seems Gitlab behaves like ECR for the subject. After testing with https://github.com/moby/buildkit/pull/6191, it now gives:
#7 exporting to image
#7 pushing layers 4.3s done
#7 pushing manifest for registry.gitlab.com/test1716/test:buildkit-6171@sha256:b19cd7deb0c0b4def846a6f3709bfcc51836237385f48c5af3d122ccdf7c33b4
#7 pushing manifest for registry.gitlab.com/test1716/test:buildkit-6171@sha256:b19cd7deb0c0b4def846a6f3709bfcc51836237385f48c5af3d122ccdf7c33b4 0.5s done
#7 ERROR: failed to push registry.gitlab.com/test1716/test:buildkit-6171: unknown: manifest invalid - unknown media type: application/vnd.docker.attestation.manifest.v1+json
------
> exporting to image:
------
ERROR: failed to build: failed to solve: failed to push registry.gitlab.com/test1716/test:buildkit-6171: unknown: manifest invalid - unknown media type: application/vnd.docker.attestation.manifest.v1+json
Opened https://gitlab.com/gitlab-org/container-registry/-/issues/1679
Has been added to next GitLab Registry 18.4 milestone.
Can't push on AWS ECR: https://github.com/docker/build-push-action/actions/runs/17328491844/job/49198565117#step:11:402
This is fixed since BuildKit v0.25.0-rc1 https://github.com/docker/build-push-action/actions/runs/18127537136/job/51586465907
Opened https://gitlab.com/gitlab-org/container-registry/-/issues/1679
Has been added to next GitLab Registry 18.4 milestone.
Merged https://gitlab.com/gitlab-org/container-registry/-/issues/1679#note_2792080377 See https://gitlab.com/gitlab-org/container-registry/-/commit/139ef50d14028f3f5a3389c5e570d1aaa3dc7e08
Opened https://gitlab.com/gitlab-org/container-registry/-/issues/1679
Has been added to next GitLab Registry 18.4 milestone.
Merged https://gitlab.com/gitlab-org/container-registry/-/issues/1679#note_2792080377 See https://gitlab.com/gitlab-org/container-registry/-/commit/139ef50d14028f3f5a3389c5e570d1aaa3dc7e08
Added to 18.6 milestone