Search code examples
rustcross-compilingapple-m1

docker: no matching manifest for linux/arm64/v8 in the manifest list entries


First I tried to install the rust cross command on my M1 mac:

 cargo install -f cross

then using this command to cross compile the application:

cargo build --target x86_64-unknown-linux-musl

facing the error:

> cross build --target x86_64-unknown-linux-musl
[cross] warning: using newer rustc `1.70.0 (90c541806 2023-05-31)` for the target. Current active rustc on the host is `rustc 1.69.0 (84c898d65 2023-04-16)`.
 > Update with `rustup update`
info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
info: installing component 'rust-std' for 'x86_64-unknown-linux-musl'
 35.8 MiB /  35.8 MiB (100 %)  18.3 MiB/s in  1s ETA:  0s
Unable to find image 'ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5' locally
0.2.5: Pulling from cross-rs/x86_64-unknown-linux-musl
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
See 'docker run --help'.

what should I do to fixed this issue?


Solution

  • Do this instead

    docker pull --platform linux/amd64 ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5
    

    I had similar problem and reading this (Docker (Apple Silicon/M1 Preview) MySQL "no matching manifest for linux/arm64/v8 in the manifest list entries") helped me figure it out