From c12d3af5d8117ccc470bdda7846217171a6b5423 Mon Sep 17 00:00:00 2001 From: darksaid98 Date: Fri, 16 May 2025 08:37:29 +0200 Subject: [PATCH] feat(graalvm): ubuntu 24 and webp support --- graalvm/17/Dockerfile | 123 ++++++++++++++++++++++++++---------------- graalvm/21/Dockerfile | 123 ++++++++++++++++++++++++++---------------- 2 files changed, 156 insertions(+), 90 deletions(-) diff --git a/graalvm/17/Dockerfile b/graalvm/17/Dockerfile index d90d786..2d49346 100644 --- a/graalvm/17/Dockerfile +++ b/graalvm/17/Dockerfile @@ -1,16 +1,12 @@ -# ---------------------------------- -# Pterodactyl Core Dockerfile -# Environment: Java -# Minimum Panel Version: 1.7.0 -# ---------------------------------- -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG TARGETPLATFORM ARG JAVA_VERSION=17 LABEL author="darksaid98" maintainer="kontakt@riko.dev" -LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl-graalvm" +LABEL org.opencontainers.image.source="https://github.com/darksaid98/yolks" +LABEL org.opencontainers.image.licenses=MIT ENV DEBIAN_FRONTEND=noninteractive ENV JAVA_HOME /opt/java/graalvm @@ -19,47 +15,84 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# Environment Setup -RUN apt update -y \ - && apt install -y --no-install-recommends \ - curl \ - wget \ - fontconfig \ - ca-certificates \ - p11-kit \ - binutils \ - tzdata \ - locales \ - lsof \ - openssl \ - git \ - git-lfs \ - tar \ - sqlite3 \ - iproute2 \ - libfreetype6 \ - tini \ - && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ - && locale-gen en_US.UTF-8 \ - && rm -rf /var/lib/apt/lists/* +# Java base environment +RUN set -eux; \ + apt update -y; \ + DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + # gnupg required to verify the signature + gnupg \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ + ; \ + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ + locale-gen en_US.UTF-8; \ + rm -rf /var/lib/apt/lists/* # GraalVM Install -RUN case ${TARGETPLATFORM} in \ - "linux/amd64") ARCH=x64 ;; \ - "linux/arm64") ARCH=aarch64 ;; \ - esac \ - && wget --progress=dot:giga -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JAVA_VERSION}/latest/graalvm-jdk-${JAVA_VERSION}_linux-${ARCH}_bin.tar.gz \ - && mkdir -p "${JAVA_HOME}" \ - && tar --extract \ - --file /tmp/graalvm.tar.gz \ - --directory "${JAVA_HOME}" \ - --strip-components 1 \ - --no-same-owner \ - && rm -rf /tmp/graalvm.tar.gz +RUN set -eux; \ + case ${TARGETPLATFORM} in \ + "linux/amd64") ARCH=x64 ;; \ + "linux/arm64") ARCH=aarch64 ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JAVA_VERSION}/latest/graalvm-jdk-${JAVA_VERSION}_linux-${ARCH}_bin.tar.gz; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/graalvm.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -rf /tmp/graalvm.tar.gz; \ + # https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472 + find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \ + ldconfig; \ + # https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 + # https://openjdk.java.net/jeps/341 + java -Xshare:dump; -# Java info -RUN echo "javac --version"; javac --version \ - && echo "java --version"; java --version +# Verify Java installation +RUN set -eux; \ + echo "Verifying install ..."; \ + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ + echo "Complete." + +# Misc standard packages to ship with image +RUN set -eux; \ + apt update -y; \ + DEBIAN_FRONTEND=noninteractive apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + git-lfs \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip \ + # WebP utilities for encoding/decoding WebP images + webp ## Setup user and working directory RUN useradd -m -d /home/container -s /bin/bash container diff --git a/graalvm/21/Dockerfile b/graalvm/21/Dockerfile index 80d10ee..8ad43e9 100644 --- a/graalvm/21/Dockerfile +++ b/graalvm/21/Dockerfile @@ -1,16 +1,12 @@ -# ---------------------------------- -# Pterodactyl Core Dockerfile -# Environment: Java -# Minimum Panel Version: 1.7.0 -# ---------------------------------- -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG TARGETPLATFORM ARG JAVA_VERSION=21 LABEL author="darksaid98" maintainer="kontakt@riko.dev" -LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl-graalvm" +LABEL org.opencontainers.image.source="https://github.com/darksaid98/yolks" +LABEL org.opencontainers.image.licenses=MIT ENV DEBIAN_FRONTEND=noninteractive ENV JAVA_HOME /opt/java/graalvm @@ -19,47 +15,84 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# Environment Setup -RUN apt update -y \ - && apt install -y --no-install-recommends \ - curl \ - wget \ - fontconfig \ - ca-certificates \ - p11-kit \ - binutils \ - tzdata \ - locales \ - lsof \ - openssl \ - git \ - git-lfs \ - tar \ - sqlite3 \ - iproute2 \ - libfreetype6 \ - tini \ - && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ - && locale-gen en_US.UTF-8 \ - && rm -rf /var/lib/apt/lists/* +# Java base environment +RUN set -eux; \ + apt update -y; \ + DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + # gnupg required to verify the signature + gnupg \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ + ; \ + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ + locale-gen en_US.UTF-8; \ + rm -rf /var/lib/apt/lists/* # GraalVM Install -RUN case ${TARGETPLATFORM} in \ - "linux/amd64") ARCH=x64 ;; \ - "linux/arm64") ARCH=aarch64 ;; \ - esac \ - && wget --progress=dot:giga -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JAVA_VERSION}/latest/graalvm-jdk-${JAVA_VERSION}_linux-${ARCH}_bin.tar.gz \ - && mkdir -p "${JAVA_HOME}" \ - && tar --extract \ - --file /tmp/graalvm.tar.gz \ - --directory "${JAVA_HOME}" \ - --strip-components 1 \ - --no-same-owner \ - && rm -rf /tmp/graalvm.tar.gz +RUN set -eux; \ + case ${TARGETPLATFORM} in \ + "linux/amd64") ARCH=x64 ;; \ + "linux/arm64") ARCH=aarch64 ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/${JAVA_VERSION}/latest/graalvm-jdk-${JAVA_VERSION}_linux-${ARCH}_bin.tar.gz; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/graalvm.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -rf /tmp/graalvm.tar.gz; \ + # https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472 + find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \ + ldconfig; \ + # https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 + # https://openjdk.java.net/jeps/341 + java -Xshare:dump; -# Java info -RUN echo "javac --version"; javac --version \ - && echo "java --version"; java --version +# Verify Java installation +RUN set -eux; \ + echo "Verifying install ..."; \ + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ + echo "Complete." + +# Misc standard packages to ship with image +RUN set -eux; \ + apt update -y; \ + DEBIAN_FRONTEND=noninteractive apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + git-lfs \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip \ + # WebP utilities for encoding/decoding WebP images + webp ## Setup user and working directory RUN useradd -m -d /home/container -s /bin/bash container