You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to build GraalVM native image for ARM architecture from my AMD machine.
It such feature currently supported by native-packager ?
As for now I have tried to use docker image with hash in GraalVMNativeImagePlugin.generateContainerBuildImage() what should allow me to pull ARM based docker image.
@muuki88 Can you describe the steps needed to implement this feature here ? It looks as if there need to extend FROM directive with platform parameter but you are probably aware of other places that should be changed ;)
I'm not an expert on GraalVM's native-image, but from what I understand is that the resulting executable is both OS and CPU architecture specific. I've been able to build linux/arm64 binaries successfully using this setting on my ARM64 Macbook: graalVMNativeImageGraalVersion := Some("22.0.0.2"). I can then containerise the native-image using a Dockerfile such as:
FROM oraclelinux:8-slim
COPY ./target/graal-native-image/my-application ./app/
CMD ./app/my-application
Assuming my understanding is correct of how native-image builds work, if you want to build a macos/arm64 binary instead that you can run locally and not in a container, you're out of luck until there is a macos/arm64 version of GraalVM/native-image. You can keep an eye out for new GraalVM releases here, and look out for something tagged darwin-aarch64-XXXX.tar.gz
for MacOS on MX CPU (ARM64) simply use macos-latest and for MacOS on X64 use macos-13
For Windows and Linux there are no ARM64 runners/images/vms available yet. This is likely to change soon. Otherwise you need to setup your own runner. For Linux you could even use ubuntu aem64 image via docker inside of MacOS ARM64.
Activity
f0o commentedon Nov 25, 2021
@muuki88
Is there any news regarding this? We might be facing a similar issue where we want to provide multi-arch Docker Images
muuki88 commentedon Nov 25, 2021
I'm happy to help you with implementing this feature😊, but I don't have the time nor the experience or setup to build this 😃
dswiecki commentedon Dec 13, 2021
@muuki88 Can you describe the steps needed to implement this feature here ? It looks as if there need to extend FROM directive with platform parameter but you are probably aware of other places that should be changed ;)
muuki88 commentedon Dec 14, 2021
I have no real experience with graal + docker and especially not ARM 😅
However the concept for all formats in native packager is always the same
Docker / stageputs all files along with a Dockerfile in the target/docker folderStep 1 should already be available, so it's only part 2. I'll check later what SBT tasks and settings are available.
What would the packaging command look like?
kyri-petrou commentedon Mar 4, 2022
I'm not an expert on GraalVM's native-image, but from what I understand is that the resulting executable is both OS and CPU architecture specific. I've been able to build
linux/arm64binaries successfully using this setting on my ARM64 Macbook:graalVMNativeImageGraalVersion := Some("22.0.0.2"). I can then containerise thenative-imageusing a Dockerfile such as:Assuming my understanding is correct of how
native-imagebuilds work, if you want to build amacos/arm64binary instead that you can run locally and not in a container, you're out of luck until there is amacos/arm64version of GraalVM/native-image. You can keep an eye out for new GraalVM releases here, and look out for something taggeddarwin-aarch64-XXXX.tar.gzI hope that helps!
hohwille commentedon Jan 6, 2025
For the record:
macos-latestand for MacOS on X64 usemacos-13https://github.com/actions/runner-images?tab=readme-ov-file#available-images
https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
hohwille commentedon Jan 6, 2025
oracle/graal#2757