Skip to content

ECR rejects OCI 1.1 referrer manifests during recursive copy (oras copy -r) #2783

Description

@GTRekter

Summary

Amazon ECR returns 405 Method Not Allowed when pushing OCI 1.1 referrer manifests (manifests containing artifactType and subject fields) via oras copy -r. The same operation succeeds against Azure ACR, which fully supports OCI 1.1. This appears related to #2306.

Environment

  • ORAS CLI: v1.3.0 (Homebrew)
  • ECR region: us-east-1
  • Source registry: ghcr.io (GitHub Container Registry)
  • Source image: ghcr.io/buoyantio/extension-init:enterprise-2.19.4-fips

Description

The source image includes an SPDX SBOM referrer that conforms to the OCI Image 1.1 specification, using the artifactType and subject fields introduced in that spec:

oras discover ghcr.io/buoyantio/extension-init:enterprise-2.19.4-fips

ghcr.io/buoyantio/extension-init@sha256:979085578a3e094c016ca31f84b1f6ecd9a823863d95fda712e5c589dbebf134
└── application/spdx+json
    └── sha256:08c1ef07d76dfb86f9236371b39ee3888639cc7c77a2e4535e304191f77cbd49

The referrer manifest includes both OCI 1.1 fields:

{
  "schemaVersion": 2,
  "mediaType": "...",
  "artifactType": "application/spdx+json",
  "config": {...},
  "layers": [...],
  "subject": {
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "digest": "sha256:979085578a3e094c016ca31f84b1f6ecd9a823863d95fda712e5c589dbebf134",
    "size": 518
  },
  "annotations": {...}
}

Steps to reproduce

  1. Create an ECR repository:
aws ecr create-repository --region us-east-1 \
  --repository-name test/buoyantio/extension-init
  1. Authenticate with ECR:
aws ecr get-login-password --region us-east-1 | \
  docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com
  1. Attempt a recursive copy:
oras copy -r \
  ghcr.io/buoyantio/extension-init@sha256:979085578a3e094c016ca31f84b1f6ecd9a823863d95fda712e5c589dbebf134 \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/test/buoyantio/extension-init:enterprise-2.19.4-fips

Expected behavior

The image index and its SPDX SBOM referrer are both pushed to ECR, consistent with AWS's announced OCI 1.1 support.

Actual behavior

The base image layers are pushed successfully, but ECR rejects the referrer manifest with:

PUT ".../manifests/sha256:2d0586ea25f4..." → 405 Method Not Allowed

{
  "errors": [{
    "code": "UNSUPPORTED",
    "message": "Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'"
  }]
}

The error suggests ECR's manifest validation is rejecting the OCI 1.1 referrer manifest, despite the manifest being valid JSON and conforming to the spec.

Comparison with Azure ACR

The identical oras copy -r operation completes successfully against Azure ACR, which announced OCI 1.1 support in 2024. Both the image digest and the SPDX SBOM referrer are copied without errors.

Current workaround

Dropping the -r flag copies the image without referrers:

oras cp \
  ghcr.io/buoyantio/extension-init@sha256:979085578a3e094c016ca31f84b1f6ecd9a823863d95fda712e5c589dbebf134 \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/test/buoyantio/extension-init:enterprise-2.19.4-fips

This succeeds but does not copy the SPDX SBOM referrer, which breaks supply-chain attestation workflows.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    ECRAmazon Elastic Container Registry

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions