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

Cross compilation ready Dockerfile (for arm images) #14559

Open
AFCMS opened this issue Apr 19, 2024 · 3 comments
Open

Cross compilation ready Dockerfile (for arm images) #14559

AFCMS opened this issue Apr 19, 2024 · 3 comments
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors Feature request Issues that request the addition or enhancement of a feature

Comments

@AFCMS
Copy link
Contributor

AFCMS commented Apr 19, 2024

Follows #14230

Problem

Currently the image built by the CI only works on amd64 architecture, GitHub Actions doesn't provide ARM runners to build a ARM images natively.

ARM images would be pretty useful for RasberryPI servers, and there are a lot of other platforms supported by Alpine which could benefit from an official image.

Solutions

There are three ways to build ARM images:

  • QEMU based, Docker buildx supports it quite well, but GitHub Actions runners don't enable virtualisation acceleration so the build takes a loooong time (more than one hour)
  • Cross compilation support in the Dockerfile
  • Wait for GitHub to provide non-M1 ARM runners

While cross compilation is easy when it comes to Rust or Go, it's a bit harder for C/C++.

There is this project by a Docker employee which makes things a bit easier: https://github.com/tonistiigi/xx

Alternatives

Do nothing, leave people on ARM hardware build the image themselves.

Additional context

No response

@AFCMS AFCMS added the Feature request Issues that request the addition or enhancement of a feature label Apr 19, 2024
@suryaoruganti
Copy link

You can use WarpBuild for natively provided arm64 runners.

It'll help speed up those builds.
Note: I'm the founder.

@AFCMS
Copy link
Contributor Author

AFCMS commented Apr 20, 2024

I think its ultimately better to setup cross-compilation, it could benefit to people who want to test locally or deploy a custom Minetest build onto an ARM PC.

I am currently working on it 👍

@wsor4035 wsor4035 added the @ Build CMake, build scripts, official builds, compiler and linker errors label Apr 21, 2024
@AFCMS
Copy link
Contributor Author

AFCMS commented May 14, 2024

Apparently GitHub started deploying non-M1 ARM runners with a private beta for enterprises and apparently some open-source projects have access already to them. 🥳

For reference if Minetest get access: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors Feature request Issues that request the addition or enhancement of a feature
Projects
None yet
Development

No branches or pull requests

3 participants