Open
Description
Describe the bug
Using --platform
when copying a multi-platform image with gcrane
seems to have no effect. The same works as expected with crane
.
To Reproduce
Copy image, select platform linux/amd64
:
gcrane cp --platform linux/amd64 \
busybox:1.35.0 \
europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.35.0
Get the manifest:
gcrane manifest europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.35.0
This returns a manifest with mediaType: application/vnd.oci.image.index.v1+json
and multiple platforms listed.
Also, pulling a different platform (linux/arm64
) works fine:
docker pull --platform linux/arm64 \
europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.35.0
Expected behavior
Only the selected platform is copied, like with crane
.
Working example with crane
Copy image, select platform linux/amd64
:
crane cp --platform linux/amd64 \
busybox:1.36.0 \
europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.36.0
Get the manifest:
crane manifest europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.36.0
This returns a manifest with mediaType: application/vnd.docker.distribution.manifest.v2+json
.
Also, pulling a different platform (linux/arm64
):
docker pull --platform linux/arm64 \
europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.36.0
Returns the expected error:
image with reference europe-west1-docker.pkg.dev/my-project/my-images/busybox:1.36.0 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64
Additional context
$ gcrane version && crane version
v0.20.3
v0.20.3
Source or target registry seems to not matter.