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

docker images are only available for amd64 #645

Closed
allexoll opened this issue Feb 24, 2022 · 7 comments
Closed

docker images are only available for amd64 #645

allexoll opened this issue Feb 24, 2022 · 7 comments

Comments

@allexoll
Copy link

Currently all docker image released for cross are amd64. This means that all other host platform will have to run it trough an emulation layer, which slows it down by a lot, where if the images were published for multiple arch, docker would choose it based on the host arch.

example:

Hos: aarch64-apple-darwin

> uname -a
Darwin laptop.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

Target I want to compile for: aarch64-unknown-linux-gnu

> docker run --rm -it rustembedded/cross:aarch64-unknown-linux-gnu "sh" -c  "uname -a"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Linux 23858603f374 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

which is not very efficient when it works, if at all, because the whole thing is run trough qemu_x86_64 for arm.

I'm not sure how easy it would be to build & publish the same set of images for other arch, but i think that's an issue that other docker images publisher have solved?

I'd be happy to look into if if that support is a wanted enhancement when i have the time, but i'd happily take pointers on how to test the potential solution.

Best,

allexoll

@Emilgardis
Copy link
Member

Thanks for the issue! I think we can solve this quite easily with docker buildx.

@allexoll
Copy link
Author

I don't think it is that easy... Some dockerfiles also install libc6-dev cross and g++ cross, which would be inexistant if the mapping is host arch == target arch.

For example if i want to build a aarch64 image for a aarch64 host,

RUN apt-get install --assume-yes --no-install-recommends \
    g++-aarch64-linux-gnu \
    libc6-dev-arm64-cross

That would fail because they are not available. QEMU would also not be needed in this case, and the linux-runner also intends to be running on x86_64 or i?86, otherwise it runs trough QEMU.

I'm sure other examples apply but this at least is an issue.

the opposite would happen too: if i want to build a aarch64 image for x86_64 target, there would be missing those two because it was intended to be run with g++ native.

The first solution that comes to mind would be to build a 46x46 matrix of {host}x{target} but that not a good idea.

Anybody has an idea?

@davidcole1340
Copy link

I started updating the docker images to support AArch64 however have not worked on it for a while: #567

@allexoll
Copy link
Author

I had a look and it seems that it confirms some of my worries about the complexity of this endeavor. we would need some testing to see if a target-specific compiler would be needed depending on the host arch for each image. I'm also not sure what the space limitation is on dockerhub...

@Emilgardis
Copy link
Member

Emilgardis commented Feb 25, 2022

I'm also not sure what the space limitation is on dockerhub...

We're moving away from dockerhub, see #609 for switching to GHCR instead

@nashley
Copy link

nashley commented Jul 15, 2022

Looks like work on this is being tracked here now? #751

@Alexhuszagh
Copy link
Contributor

Nice catch, this is also partially resolved by #817.

@Emilgardis Emilgardis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants