Open ghost opened 3 years ago
@muuki88 Is there any news regarding this? We might be facing a similar issue where we want to provide multi-arch Docker Images
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 😃
@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 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 / stage
puts 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?
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
I hope that helps!
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.Ex:
GraalVMNativeImagePlugin.generateContainerBuildImage("ghcr.io/graalvm/graalvm-ce:latest@sha256:94a029ea80df5d66e5f49d30a1a4348b654e2cb8ccc7a26ec209691943a2ee8e")
Unfortunately it results in error
Error response from daemon: build tag cannot contain a digest
Information