I'm attempting to build a docker image locally on my m1 mac. The application inside of the docker image is a java application built with jlink
.
When attempting to run the docker image with the java application embedded in it, i get an error saying No java detected
.
When I enter into the container, and try to do ./jre/bin/java -version
, I get this error from Java
bitcoin-s@d672864e1b18:/opt/docker$ ./jre/bin/java
bash: ./jre/bin/java: cannot execute binary file: Exec format error
However this is confusing to me, as I said in the title, this is built on an m1 mac with java that supports aarch64. I would imagine the jre produced by jlink
would also support aarch64
in the docker image?
Too be clear, i am running attempting to build AND run the docker image on the same host machine which is an m1 mac.
If its relevant, the version of java I am using on my m1 mac is
java -version
openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing)
When I pull a remotely built linux version of the docker container, and attempt to run java inside the container, I get this error
./jre/bin/java -version
/lib64/ld-linux-x86-64.so.2: No such file or directory