Skip to content

Commit

Permalink
Merge pull request #93 from brahimhaddou/master
Browse files Browse the repository at this point in the history
Update GraalVM dockerfiles
  • Loading branch information
brahimhaddou authored Jul 18, 2024
2 parents 63cf342 + 99ace4a commit d65dc5d
Show file tree
Hide file tree
Showing 53 changed files with 130 additions and 1,476 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Learn more at [Oracle Help Center](https://docs.oracle.com/en/graalvm/jdk/21/doc

GraalVM Community Edition container images are published in this GitHub Container Registry.
There are different GraalVM Community Edition container images provided depending on the architecture and the Java version.
The container images for the latest GraalVM versions (GraalVM for JDK 17, GraalVM for JDK 20, and GraalVM for JDK 21) have a `-community` suffix.
The container images for the latest GraalVM versions (GraalVM for JDK 17, GraalVM for JDK 21, and GraalVM for JDK 22) have a `-community` suffix.
These are: **native-image-community**, **jdk-community**, **truffleruby-community**, **nodejs-community**, and **graalpy-community**.
The container images are multi-arch, for AMD64 and AArch64 processor architectures, and Linux version.

Expand Down Expand Up @@ -56,20 +56,20 @@ The following tags are listed from the most-specific tag (at the top) to the lea
The most-specific tag is unique and always points to the same image, while the less-specific tags point to newer image variants over time.

```
21.0.0-ol9-20230919
21.0.0-ol9
21.0.0
21-ol9
21
22.0.2-ol9-20240716
22.0.2-ol9
22.0.2
22-ol9
22
```

To pull GraalVM for a specific JDK version, for example, 21, run from a command line:
To pull GraalVM for a specific JDK version, for example, 22, run from a command line:
```
$ docker pull ghcr.io/graalvm/graalvm-community:21
$ docker pull ghcr.io/graalvm/graalvm-community:22
```
To use GraalVM JDK as base image in Dockerfile, use:
```
FROM ghcr.io/graalvm/graalvm-community:21
FROM ghcr.io/graalvm/graalvm-community:22
```

Read more about GraalVM Community Edition container images [here](https://www.graalvm.org/docs/getting-started/container-images/).
Expand All @@ -82,10 +82,10 @@ To fix the image and allow no updates, you need to use a full version with a rel
ghcr.io/graalvm/$IMAGE_NAME[:][$java_version][-$os_version][-$date]
```

For example, `ghcr.io/graalvm/jdk-community:21.0.0-ol9-20230919`.
For example, `ghcr.io/graalvm/jdk-community:22.0.2-ol9-20240716`.

You can also set an image to a specific Java version that allows an update for a subversion to be pulled.
For instance, using `ghcr.io/graalvm/jdk-community:latest`, the image will be updated for 23.1.x releases, but not for 23.0.0.
For instance, using `ghcr.io/graalvm/jdk-community:latest`, the image will be updated for 24.0.x releases, but not for 23.0.0.
Using `ghcr.io/graalvm/native-image-community` you will always get the latest update available for Native Image GraalVM Community Edition, the latest OS which is now Oracle Linux 9 and Oracle Linux 9 slim, and the latest Java version.

Note some terms and restrictions that may apply to the open source technology.
Expand Down
8 changes: 4 additions & 4 deletions graalpy-community/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz

WORKDIR /app
Expand All @@ -26,7 +26,7 @@ ENV LANG=en_US.UTF-8 \

RUN set -eux \
&& apt-get update -y \
&& apt-get install -y locales ca-certificates curl tar gzip libz-dev libssl-dev gcc make unzip patch \
&& apt-get install -y locales ca-certificates curl tar gzip libz-dev libssl-dev gcc g++ make unzip patch \
&& rm -rf /var/lib/apt/lists/*


Expand All @@ -37,7 +37,7 @@ RUN set -eux \
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD ["graalpy"]
11 changes: 6 additions & 5 deletions graalpy-community/Dockerfile.ol7
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,28 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

WORKDIR /app

ENV LANG=en_US.UTF-8 \
PATH=/opt/graalpy-$GRAALVM_VERSION/bin:$PATH
PATH=/opt/graalpy-$GRAALVM_VERSION/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH

RUN set -eux \
&& echo "$TEMP_REGION" > /etc/yum/vars/ociregion \
&& yum update -y oraclelinux-release-el7 \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en \
&& yum install -y oracle-softwarecollection-release-el7 \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc devtoolset-10-gcc-c++ make patch glibc-langpack-en \
&& echo "" > /etc/yum/vars/ociregion \
&& rm -rf /var/cache/yum

RUN set -eux \
&& mkdir -p /opt/graalpy-$GRAALVM_VERSION \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

ENTRYPOINT ["graalpy"]
11 changes: 6 additions & 5 deletions graalpy-community/Dockerfile.ol7-slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

WORKDIR /app

ENV LANG=en_US.UTF-8 \
PATH=/opt/graalpy-$GRAALVM_VERSION/bin:$PATH
PATH=/opt/graalpy-$GRAALVM_VERSION/bin:/opt/rh/devtoolset-10/root/usr/bin:$PATH

RUN set -eux \
&& echo "$TEMP_REGION" > /etc/yum/vars/ociregion \
&& yum update -y oraclelinux-release-el7 \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en \
&& yum install -y oracle-softwarecollection-release-el7 \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc devtoolset-10-gcc-c++ make patch glibc-langpack-en \
&& echo "" > /etc/yum/vars/ociregion \
&& rm -rf /var/cache/yum

RUN set -eux \
&& mkdir -p /opt/graalpy-$GRAALVM_VERSION \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD [ "graalpy"]
8 changes: 4 additions & 4 deletions graalpy-community/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

Expand All @@ -26,15 +26,15 @@ ENV LANG=en_US.UTF-8 \
RUN set -eux \
&& echo "$TEMP_REGION" > /etc/dnf/vars/ociregion \
&& yum update -y oraclelinux-release-el8 \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en \
&& yum install -y curl tar unzip gzip zlib openssl-devel gcc gcc-c++ make patch glibc-langpack-en \
&& echo "" > /etc/dnf/vars/ociregion \
&& rm -rf /var/cache/yum

RUN set -eux \
&& mkdir -p /opt/graalpy-$GRAALVM_VERSION \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD [ "graalpy"]
8 changes: 4 additions & 4 deletions graalpy-community/Dockerfile.ol8-slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

Expand All @@ -26,15 +26,15 @@ ENV LANG=en_US.UTF-8 \
RUN set -eux \
&& echo "$TEMP_REGION" > /etc/dnf/vars/ociregion \
&& microdnf update -y oraclelinux-release-el8 \
&& microdnf install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en \
&& microdnf install -y curl tar unzip gzip zlib openssl-devel gcc gcc-c++ make patch glibc-langpack-en \
&& echo "" > /etc/dnf/vars/ociregion \
&& rm -rf /var/cache/dnf

RUN set -eux \
&& mkdir -p /opt/graalpy-$GRAALVM_VERSION \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD [ "graalpy"]
8 changes: 4 additions & 4 deletions graalpy-community/Dockerfile.ol9
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

Expand All @@ -26,7 +26,7 @@ ENV LANG=en_US.UTF-8 \
RUN set -eux \
&& echo "$TEMP_REGION" > /etc/dnf/vars/ociregion \
&& dnf install oraclelinux-release-el9 \
&& dnf install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en libxcrypt-compat \
&& dnf install -y curl tar unzip gzip zlib openssl-devel gcc gcc-c++ make patch glibc-langpack-en libxcrypt-compat \
&& echo "" > /etc/dnf/vars/ociregion \
&& rm -rf /var/cache/dnf

Expand All @@ -35,7 +35,7 @@ RUN set -eux \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1


RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD ["graalpy"]
8 changes: 4 additions & 4 deletions graalpy-community/Dockerfile.ol9-slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LABEL \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalPy is the GraalVM high-performance implementation of the Python programming language.'

ARG GRAALVM_VERSION=23.0.0
ARG GRAALVM_VERSION=24.0.2
ARG GRAALVM_PKG=https://github.com/oracle/graalpython/releases/download/graal-$GRAALVM_VERSION/graalpy-community-$GRAALVM_VERSION-linux-amd64.tar.gz
ARG TEMP_REGION=""

Expand All @@ -25,15 +25,15 @@ ENV LANG=en_US.UTF-8 \
RUN set -eux \
&& echo "$TEMP_REGION" > /etc/dnf/vars/ociregion \
&& microdnf install oraclelinux-release-el9 \
&& microdnf install -y curl tar unzip gzip zlib openssl-devel gcc make patch glibc-langpack-en libxcrypt-compat \
&& microdnf install -y curl tar unzip gzip zlib openssl-devel gcc gcc-c++ make patch glibc-langpack-en libxcrypt-compat \
&& echo "" > /etc/dnf/vars/ociregion \
&& rm -rf /var/cache/dnf

RUN set -eux \
&& mkdir -p /opt/graalpy-$GRAALVM_VERSION \
&& curl --fail --silent --location --retry 3 $GRAALVM_PKG | gunzip | tar x -C /opt/graalpy-$GRAALVM_VERSION --strip-components=1

RUN graalpy -m venv graalenv && \
echo "source graalenv/bin/activate" >> ~/.bashrc
RUN graalpy -m venv graalenv \
&& echo "source graalenv/bin/activate" >> ~/.bashrc

CMD [ "graalpy"]
55 changes: 0 additions & 55 deletions graalvm-community/Dockerfile.ol7-java20

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ LABEL \
org.opencontainers.image.title='GraalVM Community Edition' \
org.opencontainers.image.authors='GraalVM Sustaining Team <[email protected]>' \
org.opencontainers.image.description='GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Clojure, Kotlin, and LLVM-based languages such as C and C++.'


ARG TARGETPLATFORM

RUN yum update -y oraclelinux-release-el7 \
&& yum install -y oraclelinux-developer-release-el7 oracle-softwarecollection-release-el7 \
&& yum-config-manager --enable ol7_developer \
Expand All @@ -27,21 +29,20 @@ RUN yum update -y oraclelinux-release-el7 \

RUN fc-cache -f -v

ARG GRAALVM_VERSION=23.0.0
ARG JDK_BUILD=17.0.7
ARG JAVA_VERSION=java17
ARG GRAALVM_PKG=https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-$JDK_BUILD/graalvm-community-jdk-$JDK_BUILD_GRAALVM_ARCH_bin.tar.gz
ARG TARGETPLATFORM
ARG JDK_MAJOR_VERSION=22
ARG JDK_VERSION=22.0.2
ARG JDK_BUILD=+9.1
ARG GRAALVM_PKG=https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${JDK_VERSION}/graalvm-community-jdk-${JDK_VERSION}_GRAALVM_ARCH_bin.tar.gz

ENV LANG=en_US.UTF-8 \
JAVA_HOME=/opt/graalvm-community-$JAVA_VERSION
JAVA_HOME=/opt/graalvm-community-java$JDK_MAJOR_VERSION

COPY gu-wrapper.sh /usr/local/bin/gu
RUN set -eux \
&& if [ "$TARGETPLATFORM" == "linux/amd64" ]; then GRAALVM_PKG=${GRAALVM_PKG/GRAALVM_ARCH/linux-x64}; 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/ \
| gunzip | tar x -C /opt/ \
&& mv /opt/graalvm-community-openjdk-$JDK_VERSION$JDK_BUILD $JAVA_HOME \
# Set alternative links
&& mkdir -p "/usr/java" \
&& ln -sfT "$JAVA_HOME" /usr/java/default \
Expand All @@ -50,7 +51,6 @@ RUN set -eux \
base="$(basename "$bin")"; \
[ ! -e "/usr/bin/$base" ]; \
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
done \
&& chmod +x /usr/local/bin/gu
done

CMD java -version
Loading

0 comments on commit d65dc5d

Please sign in to comment.