diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e46353d..cf9cc4d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -17,6 +17,7 @@ jobs: - 11 - 17 - 19 + - 20-JDK - 11-EE - 17-EE steps: @@ -52,7 +53,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 with: - context: ./${{ matrix.tag }} + context: . + file: ./${{ matrix.tag }}/Dockerfile platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta_graalvm.outputs.tags }} diff --git a/11-EE/Dockerfile b/11-EE/Dockerfile index a4599a2..958b12e 100644 --- a/11-EE/Dockerfile +++ b/11-EE/Dockerfile @@ -15,8 +15,13 @@ LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl ENV DEBIAN_FRONTEND=noninteractive +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ + && apt-get install -y curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ && case ${TARGETPLATFORM} in \ "linux/amd64") ARCH=linux-amd64 ;; \ "linux/arm64") ARCH=linux-aarch64 ;; \ @@ -40,6 +45,6 @@ ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ./../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/11/Dockerfile b/11/Dockerfile index ffa9826..2b2edad 100644 --- a/11/Dockerfile +++ b/11/Dockerfile @@ -15,8 +15,12 @@ LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN apt-get update -y \&& apt-get install -y curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ && case ${TARGETPLATFORM} in \ "linux/amd64") ARCH=amd64 ;; \ "linux/arm64") ARCH=aarch64 ;; \ @@ -40,6 +44,6 @@ ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ./../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/17-EE/Dockerfile b/17-EE/Dockerfile index 667d18f..c5d966c 100644 --- a/17-EE/Dockerfile +++ b/17-EE/Dockerfile @@ -15,8 +15,13 @@ LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl ENV DEBIAN_FRONTEND=noninteractive +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ + && apt-get install -y curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ && case ${TARGETPLATFORM} in \ "linux/amd64") ARCH=linux-amd64 ;; \ "linux/arm64") ARCH=linux-aarch64 ;; \ @@ -39,5 +44,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ./../entrypoint.sh /entrypoint.sh + CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/17/Dockerfile b/17/Dockerfile index 18725fb..3e4fefe 100644 --- a/17/Dockerfile +++ b/17/Dockerfile @@ -15,8 +15,13 @@ LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl ENV DEBIAN_FRONTEND=noninteractive +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ + && apt-get install -y curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ && case ${TARGETPLATFORM} in \ "linux/amd64") ARCH=amd64 ;; \ "linux/arm64") ARCH=aarch64 ;; \ @@ -40,6 +45,6 @@ ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ./../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/19/Dockerfile b/19/Dockerfile index 1305381..72d6980 100644 --- a/19/Dockerfile +++ b/19/Dockerfile @@ -15,8 +15,13 @@ LABEL org.opencontainers.image.source="https://github.com/darksaid98/pterodactyl ENV DEBIAN_FRONTEND=noninteractive +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ + && apt-get install -y curl ca-certificates openssl git git-lfs tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ && case ${TARGETPLATFORM} in \ "linux/amd64") ARCH=amd64 ;; \ "linux/arm64") ARCH=aarch64 ;; \ @@ -40,6 +45,6 @@ ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh +COPY ./../entrypoint.sh /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/20-JDK/Dockerfile b/20-JDK/Dockerfile new file mode 100644 index 0000000..1c89c4c --- /dev/null +++ b/20-JDK/Dockerfile @@ -0,0 +1,48 @@ +# ---------------------------------- +# Pterodactyl Core Dockerfile +# Environment: Java +# Minimum Panel Version: 1.7.0 +# ---------------------------------- +FROM ubuntu:22.04 + +ARG TARGETPLATFORM +ARG GRAAL_VERSION=20.0.2 +ARG JAVA_VERSION=20 + +MAINTAINER RikoDEV, + +ENV DEBIAN_FRONTEND=noninteractive + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN apt-get update -y \ + && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata locales iproute2 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && case ${TARGETPLATFORM} in \ + "linux/amd64") ARCH=x64 ;; \ + "linux/arm64") ARCH=aarch64 ;; \ + esac \ + && curl --retry 3 -Lfso /tmp/graalvm.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAAL_VERSION}/graalvm-community-jdk-${GRAAL_VERSION}_linux-${ARCH}_bin.tar.gz \ + && mkdir -p /opt/java/graalvm \ + && cd /opt/java/graalvm \ + && tar -xf /tmp/graalvm.tar.gz --strip-components=1 \ + && export PATH="/opt/java/graalvm/bin:$PATH" \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/graalvm.tar.gz + +ENV JAVA_HOME=/opt/java/graalvm \ + PATH="/opt/java/graalvm/bin:$PATH" + +# Step 2 - add pterodactyl stuff +RUN useradd -d /home/container -m container + +USER container +ENV USER=container HOME=/home/container + +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh + +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 385be17..cdb4f6b 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ ___ **Enterprise Edition (EE):** Not available +### Version: GraalVM (CE, Community Edition) 20.0.2 | Java 20 + +> ghcr.io/rikodev/pterodactyl-graalvm:20-JDK + +**Enterprise Edition (EE):** Not available + ___ ## Sponsor diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..e92f3d3 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# +# Copyright (c) 2021 Matthew Penner +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Switch to the container's working directory +cd /home/container || exit 1 + +# Print Java version +printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n" +java -version + +# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell +# variable format of "${VARIABLE}" before evaluating the string and automatically +# replacing the values. +PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)") + +# Display the command we're running in the output, and then execute it with the env +# from the container itself. +printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" +# shellcheck disable=SC2086 +eval ${PARSED}