feat(graalvm): ubuntu 24 and webp support

This commit is contained in:
darksaid98 committed 2025-05-16 08:37:29 +02:00
1 parent d23b88205a
commit c12d3af5d8
2 files changed
+156 -90

No files matched your search

+78 -45
View File
@@ -1,16 +1,12 @@
# ---------------------------------- FROM ubuntu:24.04
# Pterodactyl Core Dockerfile
# Environment: Java
# Minimum Panel Version: 1.7.0
# ----------------------------------
FROM ubuntu:22.04
ARG TARGETPLATFORM ARG TARGETPLATFORM
ARG JAVA_VERSION=17 ARG JAVA_VERSION=17
LABEL author="darksaid98" maintainer="[email protected]" LABEL author="darksaid98" maintainer="[email protected]"
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 DEBIAN_FRONTEND=noninteractive
ENV JAVA_HOME /opt/java/graalvm ENV JAVA_HOME /opt/java/graalvm
@@ -19,47 +15,84 @@ ENV PATH $JAVA_HOME/bin:$PATH
# Default to UTF-8 file.encoding # Default to UTF-8 file.encoding
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
# Environment Setup # Java base environment
RUN apt update -y \ RUN set -eux; \
&& apt install -y --no-install-recommends \ apt update -y; \
curl \ DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
wget \ # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255
fontconfig \ curl \
ca-certificates \ wget \
p11-kit \ # gnupg required to verify the signature
binutils \ gnupg \
tzdata \ # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
locales \ # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
lsof \ # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077
openssl \ fontconfig \
git \ # utilities for keeping Ubuntu and OpenJDK CA certificates in sync
git-lfs \ # https://github.com/adoptium/containers/issues/293
tar \ ca-certificates p11-kit \
sqlite3 \ # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
iproute2 \ # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
libfreetype6 \ binutils \
tini \ tzdata \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
&& locale-gen en_US.UTF-8 \ locales \
&& rm -rf /var/lib/apt/lists/* ; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
rm -rf /var/lib/apt/lists/*
# GraalVM Install # GraalVM Install
RUN case ${TARGETPLATFORM} in \ RUN set -eux; \
"linux/amd64") ARCH=x64 ;; \ case ${TARGETPLATFORM} in \
"linux/arm64") ARCH=aarch64 ;; \ "linux/amd64") ARCH=x64 ;; \
esac \ "linux/arm64") ARCH=aarch64 ;; \
&& 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 \ esac; \
&& mkdir -p "${JAVA_HOME}" \ 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; \
&& tar --extract \ mkdir -p "$JAVA_HOME"; \
--file /tmp/graalvm.tar.gz \ tar --extract \
--directory "${JAVA_HOME}" \ --file /tmp/graalvm.tar.gz \
--strip-components 1 \ --directory "$JAVA_HOME" \
--no-same-owner \ --strip-components 1 \
&& rm -rf /tmp/graalvm.tar.gz --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 # Verify Java installation
RUN echo "javac --version"; javac --version \ RUN set -eux; \
&& echo "java --version"; java --version 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 ## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container RUN useradd -m -d /home/container -s /bin/bash container
+78 -45
View File
@@ -1,16 +1,12 @@
# ---------------------------------- FROM ubuntu:24.04
# Pterodactyl Core Dockerfile
# Environment: Java
# Minimum Panel Version: 1.7.0
# ----------------------------------
FROM ubuntu:22.04
ARG TARGETPLATFORM ARG TARGETPLATFORM
ARG JAVA_VERSION=21 ARG JAVA_VERSION=21
LABEL author="darksaid98" maintainer="[email protected]" LABEL author="darksaid98" maintainer="[email protected]"
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 DEBIAN_FRONTEND=noninteractive
ENV JAVA_HOME /opt/java/graalvm ENV JAVA_HOME /opt/java/graalvm
@@ -19,47 +15,84 @@ ENV PATH $JAVA_HOME/bin:$PATH
# Default to UTF-8 file.encoding # Default to UTF-8 file.encoding
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
# Environment Setup # Java base environment
RUN apt update -y \ RUN set -eux; \
&& apt install -y --no-install-recommends \ apt update -y; \
curl \ DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
wget \ # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255
fontconfig \ curl \
ca-certificates \ wget \
p11-kit \ # gnupg required to verify the signature
binutils \ gnupg \
tzdata \ # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
locales \ # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
lsof \ # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077
openssl \ fontconfig \
git \ # utilities for keeping Ubuntu and OpenJDK CA certificates in sync
git-lfs \ # https://github.com/adoptium/containers/issues/293
tar \ ca-certificates p11-kit \
sqlite3 \ # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
iproute2 \ # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
libfreetype6 \ binutils \
tini \ tzdata \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
&& locale-gen en_US.UTF-8 \ locales \
&& rm -rf /var/lib/apt/lists/* ; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
rm -rf /var/lib/apt/lists/*
# GraalVM Install # GraalVM Install
RUN case ${TARGETPLATFORM} in \ RUN set -eux; \
"linux/amd64") ARCH=x64 ;; \ case ${TARGETPLATFORM} in \
"linux/arm64") ARCH=aarch64 ;; \ "linux/amd64") ARCH=x64 ;; \
esac \ "linux/arm64") ARCH=aarch64 ;; \
&& 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 \ esac; \
&& mkdir -p "${JAVA_HOME}" \ 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; \
&& tar --extract \ mkdir -p "$JAVA_HOME"; \
--file /tmp/graalvm.tar.gz \ tar --extract \
--directory "${JAVA_HOME}" \ --file /tmp/graalvm.tar.gz \
--strip-components 1 \ --directory "$JAVA_HOME" \
--no-same-owner \ --strip-components 1 \
&& rm -rf /tmp/graalvm.tar.gz --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 # Verify Java installation
RUN echo "javac --version"; javac --version \ RUN set -eux; \
&& echo "java --version"; java --version 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 ## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container RUN useradd -m -d /home/container -s /bin/bash container