From 0f809e27bba5a83caf9f31fee9b41fc347f34acb Mon Sep 17 00:00:00 2001 From: OowhitecatoO Date: Sun, 2 Aug 2026 19:54:08 +0800 Subject: [PATCH] Restore the GraalVM image variants (#4205) --- .github/workflows/build.yml | 15 +++++++++++++++ .github/workflows/verify-pr.yml | 9 +++++++++ build/ol/install-packages.sh | 16 ++++++---------- build/ol/setup-user.sh | 4 ++++ docs/versions/java.md | 6 +++++- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b8ccad4..37237f9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,10 +30,13 @@ jobs: - java25 - java25-alpine - java25-jdk + - java25-graalvm - java21 - java21-alpine + - java21-graalvm - java21-jdk - java17 + - java17-graalvm - java16 - java11 - java8 @@ -54,6 +57,10 @@ jobs: baseImage: eclipse-temurin:25 platforms: linux/amd64,linux/arm64 mcVersion: latest + - variant: java25-graalvm + baseImage: container-registry.oracle.com/graalvm/jdk:25-ol10 + platforms: linux/amd64,linux/arm64 + mcVersion: latest # JAVA 21: - variant: java21 baseImage: eclipse-temurin:21-jre @@ -67,12 +74,20 @@ jobs: baseImage: eclipse-temurin:21-jre-alpine platforms: linux/amd64,linux/arm64 mcVersion: 1.21.11 + - variant: java21-graalvm + baseImage: container-registry.oracle.com/graalvm/jdk:21-ol10 + platforms: linux/amd64,linux/arm64 + mcVersion: 1.21.11 # JAVA 17: - variant: java17 # jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343 baseImage: eclipse-temurin:17-jre-focal platforms: linux/amd64,linux/arm/v7,linux/arm64 mcVersion: 1.20.4 + - variant: java17-graalvm + baseImage: container-registry.oracle.com/graalvm/jdk:17-ol10 + platforms: linux/amd64,linux/arm64 + mcVersion: 1.20.4 # JAVA 16 - variant: java16 baseImage: adoptopenjdk:16-jre-hotspot diff --git a/.github/workflows/verify-pr.yml b/.github/workflows/verify-pr.yml index 84d5d15f..ddeec134 100644 --- a/.github/workflows/verify-pr.yml +++ b/.github/workflows/verify-pr.yml @@ -24,6 +24,7 @@ jobs: variant: - java25 - java25-alpine + - java25-graalvm - java17 - java8 include: @@ -39,6 +40,11 @@ jobs: mcVersion: latest # For GLIBC_2.34 support (and Alpine) knockdRepoOrg: Metalcape/knock + - variant: java25-graalvm + # stay aligned with build.yml + baseImage: container-registry.oracle.com/graalvm/jdk:25-ol10 + platforms: linux/amd64,linux/arm64 + mcVersion: latest # JAVA 17: - variant: java17 # jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343 @@ -69,6 +75,9 @@ jobs: - name: Setup Docker Buildx uses: docker/setup-buildx-action@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v4.2.0 + - name: Confirm multi-arch build uses: docker/build-push-action@v7 with: diff --git a/build/ol/install-packages.sh b/build/ol/install-packages.sh index 0df8727b..460fec7e 100755 --- a/build/ol/install-packages.sh +++ b/build/ol/install-packages.sh @@ -66,16 +66,12 @@ fi # Clean up DNF when done dnf clean all -cat < /usr/local/sbin/knockd -#!/bin/sh - -echo "Auto-pause (using knockd) is currently unavailable on graalvm image variants" -echo "Consider using a different image variant https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/" -echo "or mc-router's auto scale up/down feature https://github.com/itzg/mc-router#docker-auto-scale-updown" -exit 2 -EOF -chmod 755 /usr/local/sbin/knockd -# TODO restore retrieval from https://github.com/Metalcape/knock when tar's "Cannot open: Invalid argument" is solved +# Download and install patched knockd +curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz +tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz +ln -s /usr/local/sbin/knockd /usr/sbin/knockd +ls -l /usr/local/sbin/knockd +setcap cap_net_raw=ep /usr/local/sbin/knockd # Set git credentials globally cat <> /etc/gitconfig diff --git a/build/ol/setup-user.sh b/build/ol/setup-user.sh index 0e495fdf..94f1944a 100755 --- a/build/ol/setup-user.sh +++ b/build/ol/setup-user.sh @@ -1,2 +1,6 @@ +#!/bin/sh + +set -e + groupadd --gid 1000 minecraft useradd --system --shell /bin/false --uid 1000 -g minecraft --home /data minecraft diff --git a/docs/versions/java.md b/docs/versions/java.md index f49eb0b6..37aa7d1a 100644 --- a/docs/versions/java.md +++ b/docs/versions/java.md @@ -17,10 +17,13 @@ where `` refers to the first column of this table: | java25 | 25 | Ubuntu | Hotspot | amd64, arm64, riscv64 | | | java25-alpine | 25 | Alpine | Hotspot | amd64, arm64 | | | java25-jdk | 25 | Ubuntu | Hotspot+JDK | amd64, arm64 | | +| java25-graalvm | 25 | Oracle | Oracle GraalVM | amd64, arm64 | (2)(3) | | java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | | | java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | | | java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 | | +| java21-graalvm | 21 | Oracle | Oracle GraalVM | amd64, arm64 | (2)(3) | | java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | | +| java17-graalvm | 17 | Oracle | Oracle GraalVM | amd64, arm64 | (2)(3) | | java16 | 16 | Ubuntu | Hotspot | amd64, arm64, armv7 | (1) | | java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | | | java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | | @@ -28,6 +31,8 @@ where `` refers to the first column of this table: Notes 1. This version of Java is [recommended for PaperMC 1.16.5](https://docs.papermc.io/paper/getting-started/#requirements) +2. Based on the [Oracle GraalVM images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise. +3. Due to these images using Oracle Linux, (which is based on Red Hat Enterprise Linux) Forge Installer will not work due to its use of zlib-ng. Use other images for initial installation and Forge version upgrade. !!! example "Example using java8" @@ -121,7 +126,6 @@ Forge also doesn't support openj9 JVM implementation. The following image tags have been deprecated and are no longer receiving updates: -- java25-graalvm, java21-graalvm, java17-graalvm - adopt13 - adopt14 - adopt15