Skip to content
Latchkey

Docker Push "unsupported MediaType" / "manifest invalid" to Registry in CI

The registry rejected the image manifest because it did not accept the media type buildx pushed. Modern buildx emits OCI-format manifests by default, and some older or strict registries only accept the classic Docker schema2 format.

What this error means

A docker buildx build --push fails on the manifest with manifest invalid: unsupported MediaType or manifest blob unknown tied to an OCI media type. The layers may upload, but the manifest is refused.

docker buildx output
failed to push: unexpected status: 400 Bad Request
manifest invalid: manifest invalid: unsupported MediaType:
application/vnd.oci.image.manifest.v1+json

Diagnose it: separate auth from naming from rate limits

Registry errors look alike and have unrelated causes. Work out which of the three you have before changing credentials, because a malformed image reference produces an error that reads like an authentication failure.

Terminal
# 1. is the reference even valid? (lowercase, no spaces, valid tag)
docker image inspect "$IMAGE" 2>&1 | head -2

# 2. are you authenticated to the right registry?
cat ~/.docker/config.json | grep -o '"[^"]*\.[^"]*"' | head

# 3. are you rate limited? (Docker Hub anonymous pulls)
curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimit-preview/test:pull" \
  | grep -o '"token"' >/dev/null && echo "token ok"

Common causes

Registry does not accept OCI media types

buildx defaults to OCI image manifests. An older registry (or one configured strictly) only understands application/vnd.docker.distribution.manifest.v2+json, so it rejects the OCI manifest.

OCI-specific features in the manifest

Provenance/SBOM attestations or annotations buildx adds can trip a registry that does not support those OCI extensions.

How to fix it

Push in Docker (schema2) media-type format

Tell buildx to emit Docker-format manifests instead of OCI.

Terminal
docker buildx build \
  --output type=image,name=myorg/api:1.4.2,oci-mediatypes=false,push=true .

Disable attestations that the registry rejects

Turn off provenance/SBOM if the registry cannot store them.

Terminal
docker buildx build --provenance=false --sbom=false --push -t myorg/api:1.4.2 .

Authenticate in the job, not in the image

.github/workflows/ci.yml
- uses: docker/login-action@v3
  with:
    registry: ghcr.io
    username: ${{ github.actor }}
    password: ${{ secrets.GITHUB_TOKEN }}

# GHCR needs this on the job or the push is rejected as unauthorised
permissions:
  contents: read
  packages: write

How to prevent it

  • Confirm the target registry supports OCI manifests before relying on them.
  • Set oci-mediatypes=false for legacy registries that need schema2.
  • Disable provenance/SBOM for registries that cannot store attestations.

Frequently asked questions

What causes Docker push "unsupported MediaType" / "manifest invalid" to registry in CI?
There are 2 common causes: registry does not accept oci media types and oci-specific features in the manifest. buildx defaults to OCI image manifests.
How do I fix Docker push "unsupported MediaType" / "manifest invalid" to registry in CI?
There are 2 fixes depending on which cause you have: push in docker (schema2) media-type format and disable attestations that the registry rejects. Work through them in order, since the first is the most common.
What does Docker push "unsupported MediaType" / "manifest invalid" to registry in CI actually mean?
A docker buildx build --push fails on the manifest with manifest invalid: unsupported MediaType or manifest blob unknown tied to an OCI media type.
How do I stop Docker push "unsupported MediaType" / "manifest invalid" to registry in CI happening again?
Confirm the target registry supports OCI manifests before relying on them. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

This is a registry failure, not a bug in your code. Latchkey detects, repairs, and retries it for you. Start free → 30-day trial · No credit card