google / go-containerregistry

Go library and CLIs for working with container registries
Apache License 2.0
3.12k stars 542 forks source link

crane: `--platform` does nothing? #1839

Open slonopotamus opened 11 months ago

slonopotamus commented 11 months ago

Describe the bug

I'm trying to create an image with non-empty platform string by passing --platform to various crane command, but none of them seem to respect it

To Reproduce

What I've tried:

  1. crane append --oci-empty-base --platform darwin/arm64 -t <tag> -f <tarball> - nope, manifest doesn't have platform in it
  2. crane tag --platform darwin/arm64 <image from previous step> <new tag> - nope
  3. crane copy --platform darwin/arm64 <image from first step> <new tag> - still nope

Expected behavior

There is some way to produce platform-specific image via crane

Additional context

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

slonopotamus commented 8 months ago

Never understood stalebots... Issues do not magically fix themselves.

pvillaverde commented 5 months ago

Same here, trying to get a list of image from a repo for a platform does not seems to work. i.e.

docker run -ti --entrypoint "" gcr.io/go-containerregistry/crane:debug sh
/ # crane ls --platform linux/amd64 registry.k8s.io/defaultbackend-amd64
1.1
1.2
1.3
1.4
1.5
/ # crane ls --platform linux/arm64 registry.k8s.io/defaultbackend-amd64
1.1
1.2
1.3
1.4
1.5

In theory this repository should not have images for arm64, and viceversa with this other one:

/ # crane ls --platform linux/arm64 registry.k8s.io/defaultbackend-arm64
1.1
1.2
1.3
1.4
1.5
/ # crane ls --platform linux/amd64 registry.k8s.io/defaultbackend-arm64
1.1
1.2
1.3
1.4
1.5
github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

slonopotamus commented 2 months ago

https://nostalebots.xyz/