google / google/go-containerregistry

crane: copy registry.k8s.io/pause:3.10 multi-platform images to quay.io failed

Open
#2,078 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
4k
Forks
686
Avg merge
2d 12h
Merged PRs (30d)
26

Description

### Describe the bug

crane copy registry.k8s.io/pause:3.10 quay.io/xin3liang0/pause:3.10 multi-platform images failed.

### To Reproduce
```
crane copy registry.k8s.io/pause:3.10 quay.io/xin3liang0/pause:3.10
2025/03/14 09:31:01 Copying from registry.k8s.io/pause:3.10 to quay.io/xin3liang0/pause:3.10
2025/03/14 09:31:02 existing manifest: sha256:e50b7059b633caf3c1449b8da680d11845cda4506b513ee7a2de00725f0a34a7
2025/03/14 09:31:02 existing manifest: sha256:7c38f24774e3cbd906d2d33c38354ccf787635581c122965132c9bd309754d4a
2025/03/14 09:31:02 existing blob: sha256:9d01e62aca03869527adbcbf895cdff3745216bb84b489638d479e0d6a02478e
...
Error: PUT https://quay.io/v2/xin3liang0/pause/manifests/sha256:e3ecdc4b6bd38ce47123195d566292581080abbb51b80603a9168f84fef0d1a2: MANIFEST_INVALID: manifest invalid; map[message:failed to parse manifest: manifest data does not match schema: 'application/vnd.docker.image.rootfs.diff.tar' is not one of ['
application/vnd.docker.image.rootfs.diff.tar.gzip', 'application/vnd.docker.image.rootfs.foreign.diff.tar.gzip']

Failed validating 'enum' in schema['properties']['layers']['items']['properties']['mediaType']:
{'description': 'The MIME type of the referenced object. This should '
'generally be '
'application/vnd.docker.image.rootfs.diff.tar.gzip. '
'Layers of type '
'application/vnd.docker.image.rootfs.foreign.diff.tar.gzip '
'may be pulled from a remote location but they should '
'never be pushed.',
'enum': ['application/vnd.docker.image.rootfs.diff.tar.gzip',
'application/vnd.docker.image.rootfs.foreign.diff.tar.gzip'],
'type': 'string'}

On instance['layers'][0]['mediaType']:
'application/vnd.docker.image.rootfs.diff.tar']

```

### Expected behavior

success

### Additional context
One workaround is to use `crane index filter` to copy multi-platform images to quay.io.
`crane index filter registry.k8s.io/pause:3.10 -t quay.io/xin3liang0/pause:3.10 --platform linux/amd64 --platform linux/arm64`

Copy docker image to quay.io works
`crane copy busybox:1.28.4 quay.io/xin3liang0/busybox:1.28.4`

- Output of `crane version`
`0.20.3`
- Registry used (e.g., GCR, ECR, Quay)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the shown `crane copy` command and compare it with `crane index filter`, focusing on multi-platform manifest handling and the reported mediaType. Trace the `crane copy` entry point and related registry manifest code. Done means copying `registry.k8s.io/pause:3.10` to Quay succeeds without the invalid `application/vnd.docker.image.rootfs.diff.tar` layer type.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.