Skip to content
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

no image found in image index for architecture "arm64", variant "v8", OS "linux" #1555

Closed
4 of 11 tasks
Coosis opened this issue Sep 7, 2024 · 2 comments
Closed
4 of 11 tasks

Comments

@Coosis
Copy link

Coosis commented Sep 7, 2024

Checklist

Describe your issue

I have a simple rust project on aarch64-darwin, targeting arm64 raspberryPi 4B. I have installed cross using cargo, I have added aarch64-unknown-linux-gnu as target via rustup, I have podman installed.
I did a cross build --target aarch64-unknown-linux-gnu, here's the output:

[15:06:23] $ cross build --target aarch64-unknown-linux-gnu
Trying to pull ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5...
Error: choosing an image from manifest list docker://ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5: no image found in image index for architecture "arm64", variant "v8", OS "linux"

What target(s) are you cross-compiling for?

aarch64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

[15:06:23] $ cross build --target aarch64-unknown-linux-gnu
Trying to pull ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5...
Error: choosing an image from manifest list docker://ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5: no image found in image index for architecture "arm64", variant "v8", OS "linux"

Additional information / notes

No response

@Coosis
Copy link
Author

Coosis commented Sep 7, 2024

Sorry, my bad. Figured it out: You have to pass in the podman flag --platform=linux/amd64 or --arch=amd64, tweak for your own requirements.
Based on Configuring cross with environment variables, you can pass flags to the container engine. You can do:
CROSS_CONTAINER_OPTS=--platform=linux/amd64 cross build --target aarch64-unknown-linux-gnu
Basically, if you fail during a build and it's image not found, inspect the url(in my case it's docker://ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5) for supported platform, and do the environment variable.

If you use nix, you can simply set up shell hook in flake.nix for this.

@Coosis Coosis closed this as completed Sep 7, 2024
@Emilgardis
Copy link
Member

See also #1214 where this has been discussed before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants