graalvm / container

GraalVM container images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arm64 graalvm-ce images contain x86 versions of GraalVM

distractedlambda opened this issue · comments

As the title says, the linux/arm64 graalvm-ce images seem to actually contain x86 versions of GraalVM.

/community/Dockerfile.ol8-java11 appears to be correct on the master branch; so I'm guessing that it's something that was wrong with their actual build process

As a work-around I'm just copying the relevant bits out of their Dockerfile and patching my own Dockerfile.

It's not clever, but all the bootstrapping has already been done.

FROM ghcr.io/graalvm/graalvm-ce:ol8-java11-22
ARG TARGETPLATFORM
ARG GRAALVM_VERSION=22.0.0.2
ARG GRAALVM_PKG=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-$GRAALVM_VERSION/graalvm-ce-java11-GRAALVM_ARCH-$GRAALVM_VERSION.tar.gz
RUN rm -rf /opt/graalvm-ce-java11-$GRAALVM_VERSION \
    && set -eux \
    && if [ "$TARGETPLATFORM" == "linux/amd64" ]; then GRAALVM_PKG=${GRAALVM_PKG/GRAALVM_ARCH/linux-amd64}; fi \
    && if [ "$TARGETPLATFORM" == "linux/arm64" ]; then GRAALVM_PKG=${GRAALVM_PKG/GRAALVM_ARCH/linux-aarch64}; fi \
    && curl --fail --silent --location --retry 3 ${GRAALVM_PKG} | gunzip | tar x -C /opt/  \
    && java -version

... Rest of my Dockerfile.

docker buildx build . --platform linux/arm64 -f graalvm/Dockerfile -t lewinc/interlok-base:graalvm-snapshot --load works since as part of my Dockerfile I execute gradle...

Thank you for your report, we will investigate this, as @quotidian-ennui mentioned, this is not an issue in the dockerfiles but seems to be some bug on build process.

This has been fixed for 22, @mlouriz please confirm backport to 21.3.1.

I'm on a windows machine today. It is currently 2022-01-31 0943 GMT

$ docker pull --platform linux/arm64 ghcr.io/graalvm/graalvm-ce:ol8-java11-22
ol8-java11-22: Pulling from graalvm/graalvm-ce
...
Digest: sha256:96c2b3fa9128ad144f1fed1f5d1d6e77655d110e9052f9c01d785f50e04e3b0b
Status: Downloaded newer image for ghcr.io/graalvm/graalvm-ce:ol8-java11-22
ghcr.io/graalvm/graalvm-ce:ol8-java11-22
$ docker-bash ghcr.io/graalvm/graalvm-ce:ol8-java11-22
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
bash-4.4# java -version
openjdk version "11.0.14" 2022-01-18
OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05)
OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05, mixed mode)
bash-4.4# cd /opt/graalvm-ce-java11-22.0.0.2/bin
bash-4.4# file java
java: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not stripped
bash-4.4#
  • It's fixed for ol8-java11-22 which fixes my variant of this issue : Thanks!
$ docker pull --platform linux/arm64 ghcr.io/graalvm/graalvm-ce:ol8-java11-21
ol8-java11-21: Pulling from graalvm/graalvm-ce
...
Digest: sha256:09e817ed9d5fa6eb55e5ccbc2540f9c5988613df9cb4a8547a7c2f7be0945689
Status: Downloaded newer image for ghcr.io/graalvm/graalvm-ce:ol8-java11-21
ghcr.io/graalvm/graalvm-ce:ol8-java11-21
$ docker-bash ghcr.io/graalvm/graalvm-ce:ol8-java11-21
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
bash-4.4# java -version
bash: /usr/bin/java: No such file or directory
bash-4.4# cd /opt/graalvm-ce-java11-21.3.1/bin
bash-4.4# file java
java: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, not stripped
bash-4.4#
  • It's an x86_x64 binary.

It's not fixed for the tag ol8-java11-21; the last updated time for the 21.x graalvm containers all date from before this issue.

@quotidian-ennui Thank you for your feedback, we are aware of this, see my comment before yours.

This has been fixed for 22, @mlouriz please confirm backport to 21.3.1.

This has been fixed for 21, please feel free to re-open if you are still facing issues.