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

Document native image cross build #1034

Open
johanandren opened this issue Oct 10, 2023 · 4 comments
Open

Document native image cross build #1034

johanandren opened this issue Oct 10, 2023 · 4 comments

Comments

@johanandren
Copy link
Member

johanandren commented Oct 10, 2023

If possible.

Right now building the graalvm samples on Apple M1/2 will result in an ARM64 image, but that is maybe not that likely to be available in cloud/edge envs.

I got as far as learning that there may be a --target flag when building the native image, but I would think that requires a GraalVM installation for the target platform as well or something?

@pvlugter
Copy link
Contributor

Still not possible, I believe. Main issue is oracle/graal#407

Currently need to build on the target platform. Can build for another arch in docker, but found the native image build didn't perform well under emulation. For the Kalix native image build, I used docker buildx with remote builder nodes. Can see notes on this here (lightbend private).

@johanandren
Copy link
Member Author

I'll PR just mentioning that for now then, can't be done locally, remote builder possible, without digging deeper into documenting and users will have to figure out the details of remote buildx builders themselves.

@johanandren
Copy link
Member Author

johanandren commented Oct 11, 2023

Ah, I see you already mentioned it in #2094 👍

Edit: that was the internal build. But maybe I can steal some text from there.

@pvlugter
Copy link
Contributor

Adding some notes on how to cross-build using docker buildx, and pointers to remote builder nodes, sounds good.

For creating binaries in CI, there's an official github action for GraalVM, and that's the currently suggested approach for cross-platform builds: https://github.com/marketplace/actions/github-action-for-graalvm

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