The registry rejects an attestation pushed before its image
CommonBuildKit 0.32 and later (Docker 29.7 and later) attach provenance as an OCI artifact whose subject is the new image manifest, and push it first. A registry that does not follow the specification's rule for subjects refuses it.
Confirm
docker buildx version
docker version --format '{{.Server.Version}}'Buildx 0.36.1 or later and Engine 29.7 or later, plus an error digest equal to the build's exporting manifest digest
Fix
- Set
BUILDX_NO_DEFAULT_OCI_ARTIFACT=1in the job before building, then rebuild and push. Buildx then stores the attestation in the older format, which has no subject. It needs Buildx 0.36.1 or later. - If you call the exporter yourself, set
oci-artifact=falseon it instead, for example--output type=registry,name=REGISTRY/IMAGE:TAG,oci-artifact=false. - Only if you do not need provenance: build with
--provenance=false --sbom=false, or setBUILDX_NO_DEFAULT_ATTESTATIONS=1. - Rebuild after changing the setting. An image already built keeps the attestation format it was built with.
export BUILDX_NO_DEFAULT_OCI_ARTIFACT=1
Before docker build or docker buildx build; Buildx 0.36.1 or later.