Open sdelamo opened 2 years ago
On an M1 mac, FROM amazonlinux:latest AS graalvm
is pulling an ARM container
The dockerfile then pulls the x86 graalvm graalvm-ce-java11-linux-amd64-22.1.0.tar.gz
and it all goes downhill from there
I generated a Micronaut CLI application via launch including the GraalVM feature. I chose Java 17, but the generated DockerfileNative contains FROM ghcr.io/graalvm/native-image:ol7-java11-22.1.0 AS graalvm
. When I run the dockerBuildNative
it shows following error and hangs:
Exception in thread "docker-java-stream--81718606" java.lang.UnsatisfiedLinkError: ~/Library/Caches/JNA/temp/jna10424641273110463416.tmp: dlopen(~/Library/Caches/JNA/temp/jna10424641273110463416.tmp, 0x0001): tried: '~/Library/Caches/JNA/temp/jna10424641273110463416.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e'))
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
When I change the generated DockerfileNative to start with ghcr.io/graalvm/native-image:ol7-java11-22.1.0 AS graalvm
and then build with the below command it works fine.
docker build --platform linux/arm64/v8 -t <image name>:latest ./build/docker/native-main -f ./build/docker/native-main/DockerfileNative
But then, when I run, I get the following:
standard_init_linux.go:228: exec user process caused: no such file or directory
When I do the whole process with dockerBuild
, it works.
any updates?
I'm able to run ./gradlew dockerBuildNative
and the image gets created successfully, but when i try to run the image I get the following error:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /app/application: no such file or directory
dockerfile {
if (System.getProperty("os.arch") == "aarch64") {
baseImage.set("public.ecr.aws/lambda/java:11-arm64")
} else {
baseImage.set("public.ecr.aws/lambda/java:11")
}
}
I get exactly the same error as @luisospina-sealed, any updates?
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /app/application: no such file or directory
I was following the steps from the micronaut guide: https://guides.micronaut.io/latest/micronaut-creating-first-graal-app-maven-java.html
Worked around it by specifying a different docker image. Couldn't find a glibc image compatible with linux/arm64, so used ubuntu for now:
<plugin>
<groupId>io.micronaut.build</groupId>
<artifactId>micronaut-maven-plugin</artifactId>
<configuration>
<baseImageRun>ubuntu:latest</baseImageRun>
</configuration>
</plugin>
I am getting same issue with maven and windows post upgrading to micronaut 4.x where as I am running it on x64 ant not arm64, https://github.com/micronaut-projects/micronaut-maven-plugin/issues/805
Issue description
Fails with: