Refactor repo structure. Add dockerfiles for every Java version

This commit is contained in:
VetheonGames 2024-06-25 08:07:02 -06:00
parent 77c99e50c4
commit 274f450dfc
11 changed files with 295 additions and 1 deletions

View File

@ -1,7 +1,7 @@
FROM eclipse-temurin:22-jammy FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com" LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://github.com/Software-Noob/pterodactyl-images" LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \ RUN apt-get update -y \

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,34 @@
FROM eclipse-temurin:22-jammy
LABEL author="PixelRidge Softworks" maintainer="connor@pixelridgesoftworks.com"
LABEL org.opencontainers.image.source="https://git.pixelridgesoftworks.com/PixelRidge-Softworks/DockerImages/src/branch/main/PterodactylImages"
LABEL org.opencontainers.image.licenses="MIT"
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 libstdc++6 lsof build-essential tzdata iproute2 locales \
&& apt-get install -y openjdk-8-jdk openjdk-11-jdk openjdk-16-jdk openjdk-17-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -d /home/container container \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
# Create a script to set the JAVA_HOME and update-alternatives based on an environment variable
RUN echo '#!/bin/bash\n\
if [ -n "$JAVA_VERSION" ]; then\n\
update-alternatives --set java /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/bin/java\n\
export JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64\n\
fi\n\
ip link set lo up\n\
exec /entrypoint.sh' > /start.sh \
&& chmod +x /start.sh
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/bin/bash", "/start.sh"]

View File

@ -0,0 +1,22 @@
#!/bin/bash
cd /home/container || exit 1
# Configure colors
CYAN='\033[0;36m'
RESET_COLOR='\033[0m'
# Print Current Java Version
java -version
# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP
# Replace Startup Variables
# shellcheck disable=SC2086
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo -e "${CYAN}STARTUP /home/container: ${MODIFIED_STARTUP} ${RESET_COLOR}"
# Run the Server
# shellcheck disable=SC2086
eval ${MODIFIED_STARTUP}