Skip to content

Describe available platforms when no match #2843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stepancheg
Copy link

@stepancheg stepancheg commented Apr 27, 2025

Tested with skopeo:

$ skopeo --insecure-policy copy --override-os=linux --override-arch=x86_64 docker://alpine dir:dir

FATA[0000] choosing an image from manifest list docker://alpine:latest: no image found in image index for architecture "x86_64", variant "", OS "linux"; available platforms: arch="amd64" os="linux" variant="", arch="unknown" os="unknown" variant="", arch="arm" os="linux" variant="v6", arch="unknown" os="unknown" variant="", arch="arm" os="linux" variant="v7", arch="unknown" os="unknown" variant="", arch="arm64" os="linux" variant="v8", arch="unknown" os="unknown" variant="", arch="386" os="linux" variant="", arch="unknown" os="unknown" variant="", arch="ppc64le" os="linux" variant="", arch="unknown" os="unknown" variant="", arch="riscv64" os="linux" variant="", arch="unknown" os="unknown" variant="", arch="s390x" os="linux" variant="", arch="unknown" os="unknown" variant=""

helped me to figure out expected spelling for x86_64 is amd64.

Signed-off-by: Stepan Koltsov <st@x.ai>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

  • If this should be done, it must be consistent between OCI indices and schema2 lists. It’s about the same code, anyway.
  • There can be multiple entries with the same platform (but differently-compressed), it would be nice not to duplicate those
  • There already is some similar code in prepareImageConfigForDest; at least some part of that can almost certainly be shared across the three locations, in some internal subpackage.
  • (And then there’s the … fun … part about designing an error message that is still readable; I suppose trying to fit it into 80 columns is a lost cause, but, well, 800 might be too much. The error message should make sense for the errors encountered by a typical user, and I’d argue that “spelling for x86_64” is a fairly rare failure — most users build images using existing tool that handle this. That’s not to say that the motivation should be discarded, but maybe eventually users could use future containers/skopeo#1283 instead of seeing everything directly inside the error message. There might not be any obviously perfect solution and having an imperfect one would still be an improvement — just, it’s something that deserves a bit of thought.)

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants