diff --git a/README.md b/README.md index f728571..9350324 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Yolks -# Original: https://github.com/pterodactyl/yolks +# Original: https://github.com/pelican-eggs/yolks A curated collection of core images that can be used with Pterodactyl's Egg system. Each image is rebuilt periodically to ensure dependencies are always up-to-date. diff --git a/apps/uptimekuma/Dockerfile b/apps/uptimekuma/Dockerfile new file mode 100644 index 0000000..c14c3fd --- /dev/null +++ b/apps/uptimekuma/Dockerfile @@ -0,0 +1,62 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:20-alpine + +LABEL author="Torsten Widmann" maintainer="info@goover.de" +LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk update \ + && apk upgrade + +RUN apk add --no-cache \ + autoconf \ + automake \ + build-base \ + ca-certificates\ + chromium \ + curl \ + bind-tools \ + ffmpeg \ + g++ \ + git \ + gpg \ + gnupg \ + iproute2 \ + iputils-ping \ + libtool \ + musl \ + musl-utils \ + musl-locales \ + python3 \ + python3-dev \ + py3-pip \ + pipx \ + sqlite \ + tzdata \ + zip \ + libc6-compat \ + tini + +# updating npm +RUN npm install npm@latest -g + +# download cloudflared +ARG TARGETPLATFORM +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; fi \ + && curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${ARCHITECTURE} -o /usr/bin/cloudflared +RUN chmod +x /usr/bin/cloudflared + +# install apprise +RUN pipx install apprise + +## Setup user and working directory +RUN adduser -D -h /home/container container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/apps/uptimekuma/entrypoint.sh b/apps/uptimekuma/entrypoint.sh new file mode 100644 index 0000000..7120b8e --- /dev/null +++ b/apps/uptimekuma/entrypoint.sh @@ -0,0 +1,41 @@ +#!/bin/ash +#System variables +clear +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +# Switch to the container's working directory +cd /home/container || exit 1 + +# Wait for the container to fully initialize +sleep 1 + +# 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 + +# system informations +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${RED}Uptime Kuma Image${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}Running on Alpine: ${RED} $(cat /etc/alpine-release)${NC}" +echo -e "${YELLOW}Current timezone: ${RED} ${TZ} ${NC}" +echo -e "${YELLOW}NodeJS Version: ${RED} $(node -v) ${NC}" +echo -e "${YELLOW}Cloudflared Version: ${RED} $(/usr/bin/cloudflared --version) ${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" + +export PATH=$PATH:/root/.local/bin + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/bot/bastion/Dockerfile b/bot/bastion/Dockerfile new file mode 100644 index 0000000..b1a7a6f --- /dev/null +++ b/bot/bastion/Dockerfile @@ -0,0 +1,26 @@ +FROM --platform=$TARGETOS/$TARGETARCH mongo:7-jammy + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +## install nodejs 20 +RUN apt update && apt install --no-install-recommends -y curl apt-transport-https ca-certificates gnupg \ + && mkdir -p /usr/share/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ + && apt update && apt install -y nodejs \ + && npm install -g npm@latest \ + ## install bastion reqs + && apt install -y python3 build-essential git libtool netcat ffmpeg iproute2 tzdata tini \ + ## add container user + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/bot/bastion/entrypoint.sh b/bot/bastion/entrypoint.sh new file mode 100644 index 0000000..8a8604a --- /dev/null +++ b/bot/bastion/entrypoint.sh @@ -0,0 +1,42 @@ +#!/bin/bash +#Variables +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +clear +#show versions +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}BastionBot Installation${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}MongoDB Version:${NC} " && mongod --version +echo -e "${YELLOW}NodeJS Version:${NC} " && node -v +echo -e "${YELLOW}Python Version:${NC} " && python3 --version +echo -e "${BLUE}-------------------------------------------------${NC}" + +cd /home/container + +# 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 +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e "${YELLOW}:/home/container${NC} ${MODIFIED_STARTUP}" + +# start mongo +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}starting MongoDB...${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" +mongod --fork --dbpath /home/container/mongodb/ --port 27017 --logpath /home/container/mongod.log --logRotate reopen --logappend && until nc -z -v -w5 127.0.0.1 27017; do echo 'Waiting for mongodb connection...'; sleep 5; done + +# Run the Server +echo -e "${BLUE}-------------------------------------------------${NC}" +echo -e "${YELLOW}BastionBot starting...${NC}" +echo -e "${BLUE}-------------------------------------------------${NC}" +eval ${MODIFIED_STARTUP} + +# stop mongo +mongod --eval "db.adminCommand({ "shutdown" : 1 })" diff --git a/bot/parkertron/Dockerfile b/bot/parkertron/Dockerfile new file mode 100644 index 0000000..ddf36fd --- /dev/null +++ b/bot/parkertron/Dockerfile @@ -0,0 +1,20 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + # general packages + && apt install -y iproute2 ca-certificates \ + # additional packages for tesseract and eng lang support + libtesseract-dev tesseract-ocr-eng \ + # add container user to run application + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/bot/parkertron/entrypoint.sh b/bot/parkertron/entrypoint.sh new file mode 100644 index 0000000..d0aea75 --- /dev/null +++ b/bot/parkertron/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# 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 +MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/bot/red/Dockerfile b/bot/red/Dockerfile new file mode 100644 index 0000000..8e1b834 --- /dev/null +++ b/bot/red/Dockerfile @@ -0,0 +1,56 @@ +FROM --platform=$TARGETOS/$TARGETARCH python:3.11-slim-bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + + +RUN mkdir -p /usr/share/man/man1 +RUN apt update \ + && apt -y upgrade \ + && apt -y install \ + git \ + ca-certificates \ + dnsutils \ + iproute2 \ + wget \ + curl \ + xz-utils \ + openjdk-17-jre-headless \ + zlib1g-dev \ + libffi-dev \ + libmagickwand-dev \ + unzip \ + libaa1-dev \ + build-essential \ + tk-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libreadline6-dev \ + libdb5.3-dev \ + libgdbm-dev \ + libsqlite3-dev \ + libssl-dev \ + libbz2-dev \ + libexpat1-dev \ + liblzma-dev \ + ffmpeg \ + imagemagick \ + tini + +RUN pip install --upgrade pip +RUN pip install python-forecastio tweepy unidecode mcstatus bs4 sqlalchemy geocoder valve python-valve py-cpuinfo psutil + +RUN mkdir -p /home/container/.config/Red-DiscordBot/ +RUN ln -s /home/container/.config/Red-DiscordBot/ /usr/local/share/Red-DiscordBot + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/bot/red/entrypoint.sh b/bot/red/entrypoint.sh new file mode 100644 index 0000000..d5bdcc7 --- /dev/null +++ b/bot/red/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# 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 +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/bot/sinusbot/Dockerfile b/bot/sinusbot/Dockerfile new file mode 100644 index 0000000..cd7b896 --- /dev/null +++ b/bot/sinusbot/Dockerfile @@ -0,0 +1,29 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL org.opencontainers.image.authors="i2007@damw.eu" +LABEL version="1.0" + +ENV DEBIAN_FRONTEND=noninteractive + +# Install Dependencies +RUN apt update \ + && apt upgrade -y \ + && apt install -y ca-certificates less locales pulseaudio python3 python3-pip sudo x11vnc x11-xkb-utils xvfb iproute2 ffmpeg curl liblcms2-2 libatomic1 libxcb-xinerama0 \ + fontconfig libasound2 libegl1-mesa libglib2.0-0 libnss3 libpci3 libpulse0 libxcursor1 libxslt1.1 libx11-xcb1 libxkbcommon0 bzip2 libxss1 libxcomposite1 libevent-2.1-7 \ + libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 tini \ + && useradd -m -d /home/container container +#RUN python3 -m pip install requests + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/bot/sinusbot/entrypoint.sh b/bot/sinusbot/entrypoint.sh new file mode 100644 index 0000000..057d59a --- /dev/null +++ b/bot/sinusbot/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash +cd /home/container + +# 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 +MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/box64/Dockerfile b/box64/Dockerfile new file mode 100644 index 0000000..4b5d43d --- /dev/null +++ b/box64/Dockerfile @@ -0,0 +1,34 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="QuintenQVD" maintainer="josdekurk@gmail.com" + +ENV DEBIAN_FRONTEND=noninteractive + +## Update base packages +RUN apt update \ + && apt upgrade -y + +## Install dependencies +RUN apt install -y libc++-dev libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools libatomic1 libsdl1.2debian libsdl2-2.0-0 \ + libfontconfig libicu72 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadb-dev libmariadb-dev-compat libduktape207 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \ + libz3-dev rapidjson-dev tzdata libevent-dev libzip4 libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 build-essential cmake libgdiplus libstdc++6 + +## Configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + + +##Install box64 +RUN wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \ + && wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg \ + && apt update && apt install box64-rpi4arm64 -y + + + +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"] diff --git a/box64/entrypoint.sh b/box64/entrypoint.sh new file mode 100644 index 0000000..b5facda --- /dev/null +++ b/box64/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'` + + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} \ No newline at end of file diff --git a/bun/canary/Dockerfile b/bun/canary/Dockerfile new file mode 100644 index 0000000..8e45326 --- /dev/null +++ b/bun/canary/Dockerfile @@ -0,0 +1,20 @@ +FROM --platform=$TARGETOS/$TARGETARCH oven/bun:canary + +LABEL author="MrAtox" maintainer="mratox@protonmail.com" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool tini \ + && useradd -m -d /home/container container + +RUN bun upgrade + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/bun/entrypoint.sh b/bun/entrypoint.sh new file mode 100644 index 0000000..c72ea71 --- /dev/null +++ b/bun/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Print Bun Version +bun -v + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/bun/latest/Dockerfile b/bun/latest/Dockerfile new file mode 100644 index 0000000..4338e03 --- /dev/null +++ b/bun/latest/Dockerfile @@ -0,0 +1,20 @@ +FROM --platform=$TARGETOS/$TARGETARCH oven/bun:latest + +LABEL author="MrAtox" maintainer="mratox@protonmail.com" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool tini \ + && useradd -m -d /home/container container + +RUN bun upgrade + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/cassandra/entrypoint.sh b/cassandra/entrypoint.sh new file mode 100644 index 0000000..b91ad64 --- /dev/null +++ b/cassandra/entrypoint.sh @@ -0,0 +1,38 @@ +#!/bin/ash + +# 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@pelican~ \033[0mjava -version\n" +java -version + + +# Print Python version +if command -v python &> /dev/null +then + printf "\033[1m\033[33mcontainer@pelican~ \033[0mpython --version\n" + python --version +else + printf "\033[1m\033[33mcontainer@pelican~ \033[0mpython3 --version\n" + python3 --version +fi + +# 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') + +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" +# shellcheck disable=SC2086 +eval "$PARSED" diff --git a/cassandra/java11_python3/Dockerfile b/cassandra/java11_python3/Dockerfile new file mode 100644 index 0000000..4f5ddb3 --- /dev/null +++ b/cassandra/java11_python3/Dockerfile @@ -0,0 +1,16 @@ +FROM --platform=$TARGETOS/$TARGETARCH adoptopenjdk/openjdk11:alpine-jre + +LABEL author="Pascal Zarrad" maintainer="p.zarrad@outlook.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache python3 py3-tz ca-certificates curl fontconfig git openssl sqlite tar tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/cassandra/java8_python2/Dockerfile b/cassandra/java8_python2/Dockerfile new file mode 100644 index 0000000..32770f4 --- /dev/null +++ b/cassandra/java8_python2/Dockerfile @@ -0,0 +1,17 @@ +FROM --platform=$TARGETOS/$TARGETARCH adoptopenjdk/openjdk8:alpine-jre + +LABEL author="Pascal Zarrad" maintainer="p.zarrad@outlook.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache python2 ca-certificates curl fontconfig git openssl sqlite tar tzdata \ + && python -m ensurepip --upgrade && pip install pytz \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/dart/2.17/Dockerfile b/dart/2.17/Dockerfile new file mode 100644 index 0000000..a40a497 --- /dev/null +++ b/dart/2.17/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH dart:2.17 + +LABEL author="Alden Bansemer" maintainer="alden@knoban.com" + +RUN apt update \ + && apt -y install iproute2 git ca-certificates tzdata tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/dart/2.18/Dockerfile b/dart/2.18/Dockerfile new file mode 100644 index 0000000..e8955f6 --- /dev/null +++ b/dart/2.18/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH dart:2.18 + +LABEL author="Alden Bansemer" maintainer="alden@knoban.com" + +RUN apt update \ + && apt -y install iproute2 git ca-certificates tzdata tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/dart/2.19/Dockerfile b/dart/2.19/Dockerfile new file mode 100644 index 0000000..cb94aa0 --- /dev/null +++ b/dart/2.19/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH dart:2.19 + +LABEL author="Alden Bansemer" maintainer="alden@knoban.com" + +RUN apt update \ + && apt -y install iproute2 git ca-certificates tzdata tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/dart/3.3/Dockerfile b/dart/3.3/Dockerfile new file mode 100644 index 0000000..a4c6b30 --- /dev/null +++ b/dart/3.3/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH dart:3.3 + +LABEL author="Alden Bansemer" maintainer="alden@knoban.com" + +RUN apt update \ + && apt -y install iproute2 git ca-certificates tzdata tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/dart/entrypoint.sh b/dart/entrypoint.sh new file mode 100644 index 0000000..2328545 --- /dev/null +++ b/dart/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Print Dart version +dart --version + +# Replace startup variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the server +eval ${MODIFIED_STARTUP} diff --git a/dart/stable/Dockerfile b/dart/stable/Dockerfile new file mode 100644 index 0000000..f8150d4 --- /dev/null +++ b/dart/stable/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH dart:stable + +LABEL author="Alden Bansemer" maintainer="alden@knoban.com" + +RUN apt update \ + && apt -y install iproute2 git ca-certificates tzdata tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/dotnet/2.1/Dockerfile b/dotnet/2.1/Dockerfile new file mode 100644 index 0000000..65f4468 --- /dev/null +++ b/dotnet/2.1/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH ghcr.io/parkervcp/yolks:debian + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt upgrade -y \ + && apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \ + && wget https://dot.net/v1/dotnet-install.sh \ + && D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/2.1 | grep -i '
$(find $modDir | head -1 | xargs stat -c%Y) ) ]]; then + # Get the mod's name from the Workshop page as well + modName=$(curl -sL https://steamcommunity.com/sharedfiles/filedetails/changelog/$modID | grep 'workshopItemTitle' | cut -d'>' -f2 | cut -d'<' -f1) + if [[ -z $modName ]]; then # Set default name if unavailable + modName="[NAME UNAVAILABLE]" + fi + if [[ ! -d $modDir ]]; then + echo -e "\n${GREEN}[UPDATE]:${NC} Downloading new Mod: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" + else + echo -e "\n${GREEN}[UPDATE]:${NC} Mod update found for: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" + fi + if [[ -n $latestUpdate ]] && [[ $latestUpdate =~ ^[0-9]+$ ]]; then # Notify last update date, if valid + echo -e "\tMod was last updated: ${CYAN}$(date -d @${latestUpdate})${NC}" + fi + + # Delete SteamCMD appworkshop cache before running to avoid mod download failures + echo -e "\tClearing SteamCMD appworkshop cache..." + rm -f ${WORKSHOP_DIR}/appworkshop_$GAME_ID.acf + + echo -e "\tAttempting mod update/download via SteamCMD...\n" + RunSteamCMD $modType $modID + fi + fi + done + + # Check over key files for unconfigured optional mods' .bikey files + for keyFile in $(find ./keys -name "*.bikey" -type f); do + keyFileName=$(basename ${keyFile}) + + # If the key file is using the optional mod file name + if [[ "${keyFileName}" == "optional_"* ]]; then + modID=$(echo "${keyFileName}" | cut -d _ -f 2) + + # If mod is not in optional mods, delete it + # If a mod is configured in CLIENT_MODS or SERVERMODS, we should still delete this file + # as a new file will have been copied that does not follow the naming scheme + if [[ "${OPTIONALMODS}" != *"@${modID};"* ]]; then + + # We only need to let the user know the key file is being deleted if this mod is no longer configured at all. + # If CLIENT_MODS contains the mod ID, we'd just confuse the user by telling them we are deleting the optional .bikey file + if [[ "${CLIENT_MODS}" != *"@${modID};"* ]]; then + echo -e "\tKey file and directory for unconfigured optional mod ${CYAN}${modID}${NC} is being deleted..." + fi + + # Delete the optional mod .bikey file and directory + rm ${keyFile} + rmdir ./@${modID}_optional 2> /dev/null + fi + fi + done; + + echo -e "${GREEN}[UPDATE]:${NC} Steam Workshop mod update check ${GREEN}complete${NC}!" + fi +fi + +# Check if specified server binary exists. +if [[ ! -f ./${SERVER_BINARY} ]]; then + echo -e "\n${RED}[STARTUP_ERR]: Specified Arma 3 server binary could not be found in the root directory!${NC}" + echo -e "${YELLOW}Please do the following to resolve this issue:${NC}" + echo -e "\t${CYAN}- Double check your \"Server Binary\" Startup Variable is correct.${NC}" + echo -e "\t${CYAN}- Ensure your server has properly installed/updated without errors (reinstalling/updating again may help).${NC}" + echo -e "\t${CYAN}- Use the File Manager to check that your specified server binary file is not missing from the root directory.${NC}\n" + exit 1 +fi + +# Make mods lowercase, if specified +if [[ ${MODS_LOWERCASE} == "1" ]]; then + for modDir in $allMods + do + ModsLowercase $modDir + done +fi + +# Define the log file path with a timestamp +LOG_FILE="/home/container/serverprofile/rpt/arma3server_$(date '+%m_%d_%Y_%H%M%S').rpt" + +# Ensure the logs directory exists +mkdir -p /home/container/serverprofile/rpt + +# Clear HC cache, if specified +if [[ ${CLEAR_CACHE} == "1" ]]; then + echo -e "\n${GREEN}[STARTUP]: ${CYAN}Clearing Headless Client profiles cache...${NC}" + for profileDir in ./serverprofile/home/* + do + [ "$profileDir" = "./serverprofile/home/Player" ] && continue + rm -rf $profileDir + done +fi + +# Check if basic.cfg exists, and download if not (Arma really doesn't like it missing for some reason) +if [[ ! -f ./basic.cfg ]]; then + echo -e "\n${YELLOW}[STARTUP_WARN]: Basic Network Configuration file \"${CYAN}basic.cfg${YELLOW}\" is missing!${NC}" + echo -e "\t${YELLOW}Downloading default file for use instead...${NC}" + curl -sSL ${BASIC_URL} -o ./basic.cfg +fi + +# Setup NSS Wrapper for use ($NSS_WRAPPER_PASSWD and $NSS_WRAPPER_GROUP have been set by the Dockerfile) +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +envsubst < /passwd.template > ${NSS_WRAPPER_PASSWD} + +if [[ ${SERVER_BINARY} == *"x64"* ]]; then # Check which libnss-wrapper architecture to run, based off the server binary name + export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss_wrapper.so +else + export LD_PRELOAD=/usr/lib/i386-linux-gnu/libnss_wrapper.so +fi + +# Replace Startup Variables +modifiedStartup=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` + +# Start Headless Clients if applicable +if [[ ${HC_NUM} > 0 ]]; then + echo -e "\n${GREEN}[STARTUP]:${NC} Starting ${CYAN}${HC_NUM}${NC} Headless Client(s)." + for i in $(seq ${HC_NUM}) + do + if [[ ${HC_HIDE} == "1" ]]; + then + ./${SERVER_BINARY} -client -connect=127.0.0.1 -port=${SERVER_PORT} -password="${SERVER_PASSWORD}" -profiles=./serverprofile -bepath=./battleye -mod="${CLIENT_MODS}" ${STARTUP_PARAMS} > /dev/null 2>&1 & + else + ./${SERVER_BINARY} -client -connect=127.0.0.1 -port=${SERVER_PORT} -password="${SERVER_PASSWORD}" -profiles=./serverprofile -bepath=./battleye -mod="${CLIENT_MODS}" ${STARTUP_PARAMS} & + fi + echo -e "${GREEN}[STARTUP]:${CYAN} Headless Client $i${NC} launched." + done +fi + +# Start the Server +echo -e "\n${GREEN}[STARTUP]:${NC} Starting server with the following startup command:" +echo -e "${CYAN}${modifiedStartup}${NC}\n" +if [[ "$STARTUP_PARAMS" == *"-noLogs"* ]]; then + ${modifiedStartup} +else + ${modifiedStartup} 2>&1 | tee -a "$LOG_FILE" +fi + +if [ $? -ne 0 ]; then + echo -e "\n${RED}PTDL_CONTAINER_ERR: There was an error while attempting to run the start command.${NC}\n" + exit 1 +fi diff --git a/games/arma3/passwd.template b/games/arma3/passwd.template new file mode 100644 index 0000000..2b0dd45 --- /dev/null +++ b/games/arma3/passwd.template @@ -0,0 +1,26 @@ +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin +bin:x:2:2:bin:/bin:/usr/sbin/nologin +sys:x:3:3:sys:/dev:/usr/sbin/nologin +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/usr/sbin/nologin +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin +systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false +systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false +systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false +systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false +syslog:x:104:108::/home/syslog:/bin/false +messagebus:x:106:109::/var/run/dbus:/bin/false +bind:x:108:112::/var/cache/bind:/bin/false +${USER}:x:${USER_ID}:${GROUP_ID}:${USER}:${HOME}:/bin/bash \ No newline at end of file diff --git a/games/dayz/Dockerfile b/games/dayz/Dockerfile new file mode 100644 index 0000000..1d74420 --- /dev/null +++ b/games/dayz/Dockerfile @@ -0,0 +1,60 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="David Wolfe (Red-Thirten)" maintainer="red_thirten@yahoo.com" + +LABEL org.opencontainers.image.source="https://github.com/pelican-eggs/yolks" +LABEL org.opencontainers.image.licenses=MIT + +## Update base packages and install dependencies +ENV DEBIAN_FRONTEND=noninteractive +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt install -y \ + curl \ + tzdata \ + locales \ + iproute2 \ + gettext-base \ + ca-certificates \ + libssl-dev \ + lib32gcc-s1 \ + libsdl2-2.0-0 \ + libsdl2-2.0-0:i386 \ + libstdc++6 \ + libstdc++6:i386 \ + lib32stdc++6 \ + libcap2 \ + libnss-wrapper \ + tini + +## install rcon client (bercon) +RUN cd /tmp/ \ + && curl -sSL https://github.com/WoozyMasta/bercon/releases/download/1.0.0/bercon > bercon \ + && mv bercon /usr/local/bin/ \ + && chmod +x /usr/local/bin/bercon + +## Configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + +## Prepare NSS Wrapper for the entrypoint as a workaround for DayZ requiring a valid UID +ENV NSS_WRAPPER_PASSWD=/tmp/passwd NSS_WRAPPER_GROUP=/tmp/group +RUN touch ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ + && chgrp 0 ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ + && chmod g+rw ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} +ADD passwd.template /passwd.template + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +## Copy over and execute entrypoint.sh via Tini +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/dayz/README.md b/games/dayz/README.md new file mode 100644 index 0000000..f13724e --- /dev/null +++ b/games/dayz/README.md @@ -0,0 +1,2 @@ +# DayZ +Docker container designed to run Bohemia Interactive's DayZ dedicated server. diff --git a/games/dayz/entrypoint.sh b/games/dayz/entrypoint.sh new file mode 100644 index 0000000..18f0854 --- /dev/null +++ b/games/dayz/entrypoint.sh @@ -0,0 +1,293 @@ +#!/bin/bash + +## File: DayZ Image - entrypoint.sh +## Author: David Wolfe (Red-Thirten) +## Contributors: Aussie Server Hosts (https://aussieserverhosts.com/) +## Date: 2024/06/05 +## License: MIT License + +## === CONSTANTS === +STEAMCMD_DIR="./steamcmd" # SteamCMD's directory containing steamcmd.sh +WORKSHOP_DIR="./Steam/steamapps/workshop" # SteamCMD's directory containing workshop downloads +STEAMCMD_LOG="${STEAMCMD_DIR}/steamcmd.log" # Log file for SteamCMD +GAME_ID=221100 # SteamCMD ID for the DayZ GAME (not server). Only used for Workshop mod downloads. + +# Color Codes +CYAN='\033[0;36m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +## === ENVIRONMENT VARS === +# STARTUP, STARTUP_PARAMS, STEAM_USER, STEAM_PASS, SERVER_BINARY, MOD_FILE, MODIFICATIONS, SERVERMODS, UPDATE_SERVER, VALIDATE_SERVER, MODS_LOWERCASE, STEAMCMD_EXTRA_FLAGS, STEAMCMD_APPID, SERVER_PASSWORD, STEAMCMD_ATTEMPTS, DISABLE_MOD_UPDATES + +## === GLOBAL VARS === +# validateServer, extraFlags, updateAttempt, modifiedStartup, allMods, CLIENT_MODS + +## === DEFINE FUNCTIONS === + +# Runs SteamCMD with specified variables and performs error handling. +function RunSteamCMD { #[Input: int server=0 mod=1; int id] + # Clear previous SteamCMD log + if [[ -f "${STEAMCMD_LOG}" ]]; then + rm -f "${STEAMCMD_LOG:?}" + fi + + updateAttempt=0 + while (( $updateAttempt < $STEAMCMD_ATTEMPTS )); do # Loop for specified number of attempts + # Increment attempt counter + updateAttempt=$((updateAttempt+1)) + + if (( $updateAttempt > 1 )); then # Notify if not first attempt + echo -e "\t${YELLOW}Re-Attempting download/update in 3 seconds...${NC} (Attempt ${CYAN}${updateAttempt}${NC} of ${CYAN}${STEAMCMD_ATTEMPTS}${NC})\n" + sleep 3 + fi + + # Check if updating server or mod + if [[ $1 == 0 ]]; then # Server + ${STEAMCMD_DIR}/steamcmd.sh +force_install_dir /home/container "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +app_update $2 $extraFlags $validateServer +quit | tee -a "${STEAMCMD_LOG}" + else # Mod + ${STEAMCMD_DIR}/steamcmd.sh "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +workshop_download_item $GAME_ID $2 +quit | tee -a "${STEAMCMD_LOG}" + fi + + # Error checking for SteamCMD + steamcmdExitCode=${PIPESTATUS[0]} + # Catch errors (ignore setlocale, SDL, steamservice, thread priority, and libcurl warnings) + loggedErrors=$(grep -i "error\|failed" "${STEAMCMD_LOG}" | grep -iv "setlocal\|SDL\|steamservice\|thread\|libcurl") + if [[ -n ${loggedErrors} ]]; then + # Soft errors + if [[ -n $(grep -i "Timeout downloading item" "${STEAMCMD_LOG}") ]]; then # Mod download timeout + echo -e "\n${YELLOW}[UPDATE]: ${NC}Timeout downloading Steam Workshop mod: \"${CYAN}${modName}${NC}\" (${CYAN}${2}${NC})" + echo -e "\t(This is expected for particularly large mods)" + elif [[ -n $(grep -i "0x402\|0x6\|0x602" "${STEAMCMD_LOG}") ]]; then # Connection issue with Steam + echo -e "\n${YELLOW}[UPDATE]: ${NC}Connection issue with Steam servers." + echo -e "\t(Steam servers may currently be down, or a connection cannot be made reliably)" + # Hard errors + elif [[ -n $(grep -i "Password check for AppId" "${STEAMCMD_LOG}") ]]; then # Incorrect beta branch password + echo -e "\n${RED}[UPDATE]: ${YELLOW}Incorrect password given for beta branch. ${CYAN}Skipping download...${NC}" + echo -e "\t(Check your \"[ADVANCED] EXTRA FLAGS FOR STEAMCMD\" startup parameter)" + break + # Fatal errors + elif [[ -n $(grep -i "Invalid Password\|two-factor\|No subscription" "${STEAMCMD_LOG}") ]]; then # Wrong username/password, Steam Guard is turned on, or host is using anonymous account + echo -e "\n${RED}[UPDATE]: Cannot login to Steam - Improperly configured account and/or credentials" + echo -e "\t${YELLOW}Please contact your administrator/host and give them the following message:${NC}" + echo -e "\t${CYAN}Your Egg, or your client's server, is not configured with valid Steam credentials.${NC}" + echo -e "\t${CYAN}Either the username/password is wrong, or Steam Guard is not properly configured\n\taccording to this egg's documentation/README.${NC}\n" + exit 1 + elif [[ -n $(grep -i "Download item" "${STEAMCMD_LOG}") ]]; then # Steam account does not own base game for mod downloads, or unknown + echo -e "\n${RED}[UPDATE]: Cannot download mod - Download failed" + echo -e "\t${YELLOW}While unknown, this error is likely due to your host's Steam account not owning the base game.${NC}" + echo -e "\t${YELLOW}(Please contact your administrator/host if this issue persists)${NC}\n" + exit 1 + elif [[ -n $(grep -i "0x202\|0x212" "${STEAMCMD_LOG}") ]]; then # Not enough disk space + echo -e "\n${RED}[UPDATE]: Unable to complete download - Not enough storage" + echo -e "\t${YELLOW}You have run out of your allotted disk space.${NC}" + echo -e "\t${YELLOW}Please contact your administrator/host for potential storage upgrades.${NC}\n" + exit 1 + elif [[ -n $(grep -i "0x606" "${STEAMCMD_LOG}") ]]; then # Disk write failure + echo -e "\n${RED}[UPDATE]: Unable to complete download - Disk write failure" + echo -e "\t${YELLOW}This is normally caused by directory permissions issues,\n\tbut could be a more serious hardware issue.${NC}" + echo -e "\t${YELLOW}(Please contact your administrator/host if this issue persists)${NC}\n" + exit 1 + else # Unknown caught error + echo -e "\n${RED}[UPDATE]: ${YELLOW}An unknown error has occurred with SteamCMD. ${CYAN}Skipping download...${NC}" + echo -e "\t(Please contact your administrator/host if this issue persists)" + break + fi + elif [[ $steamcmdExitCode != 0 ]]; then # Unknown fatal error + echo -e "\n${RED}[UPDATE]: SteamCMD has crashed for an unknown reason!${NC} (Exit code: ${CYAN}${steamcmdExitCode}${NC})" + echo -e "\t${YELLOW}(Please contact your administrator/host for support)${NC}\n" + cp -r /tmp/dumps /home/container/dumps + exit $steamcmdExitCode + else # Success! + if [[ $1 == 0 ]]; then # Server + echo -e "\n${GREEN}[UPDATE]: Game server is up to date!${NC}" + else # Mod + # Move the downloaded mod to the root directory, and replace existing mod if needed + mkdir -p ./@$2 + rm -rf ./@$2/* + mv -f ${WORKSHOP_DIR}/content/$GAME_ID/$2/* ./@$2 + rm -d ${WORKSHOP_DIR}/content/$GAME_ID/$2 + # Make the mods contents all lowercase + ModsLowercase @$2 + # Move any .bikey's to the keys directory + echo -e "\tMoving any mod ${CYAN}.bikey${NC} files to the ${CYAN}~/keys/${NC} folder..." + find ./@$2 -name "*.bikey" -type f -exec cp {} ./keys \; + echo -e "${GREEN}[UPDATE]: Mod download/update successful!${NC}" + fi + break + fi + if (( $updateAttempt == $STEAMCMD_ATTEMPTS )); then # Notify if failed last attempt + if [[ $1 == 0 ]]; then # Server + echo -e "\t${RED}Final attempt made! ${YELLOW}Unable to complete game server update. ${CYAN}Skipping...${NC}" + echo -e "\t(Please try again at a later time)" + sleep 3 + else # Mod + echo -e "\t${RED}Final attempt made! ${YELLOW}Unable to complete mod download/update. ${CYAN}Skipping...${NC}" + echo -e "\t(You may try again later, or manually upload this mod to your server via SFTP)" + sleep 3 + fi + fi + done +} + +# Takes a directory (string) as input, and recursively makes all files & folders lowercase. +function ModsLowercase { + echo -e "\n\tMaking mod ${CYAN}$1${NC} files/folders lowercase..." + for SRC in `find ./$1 -depth` + do + DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'` + if [ "${SRC}" != "${DST}" ] + then + [ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" + fi + done +} + +# Removes duplicate items from a semicolon delimited string +function RemoveDuplicates { #[Input: str - Output: printf of new str] + if [[ -n $1 ]]; then # If nothing to compare, skip to prevent extra semicolon being returned + echo $1 | sed -e 's/;/\n/g' | sort -u | xargs printf '%s;' + fi +} + +## === ENTRYPOINT START === + +# Wait for the container to fully initialize +sleep 1 + +# 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 + +# Collect and parse all specified mods +if [[ -n ${MODIFICATIONS} ]] && [[ ${MODIFICATIONS} != *\; ]]; then # Add manually specified mods to the client-side mods list, while checking for trailing semicolon + CLIENT_MODS="${MODIFICATIONS};" +else + CLIENT_MODS=${MODIFICATIONS} +fi +# If the mod list file exists and is valid, parse and add mods to the client-side mods list +if [[ -f ${MOD_FILE} ]] && [[ -n "$(cat ${MOD_FILE} | grep 'Created by DayZ Launcher')" ]]; then + CLIENT_MODS+=$(cat ${MOD_FILE} | grep 'id=' | cut -d'=' -f3 | cut -d'"' -f1 | xargs printf '@%s;') +elif [[ -n "${MOD_FILE}" ]]; then # If MOD_FILE is not null, warn user file is missing or invalid + echo -e "\n${YELLOW}[STARTUP_WARN]: DayZ Modlist file \"${CYAN}${MOD_FILE}${YELLOW}\" could not be found, or is invalid!${NC}" + echo -e "\tEnsure your uploaded modlist's file name matches your Startup Parameter." + echo -e "\tOnly files exported from a DayZ Launcher are permitted." + if [[ -n "${CLIENT_MODS}" ]]; then + echo -e "\t${CYAN}Reverting to the manual mod list...${NC}" + fi +fi +# Add server mods to the master mods list, while checking for trailing semicolon +if [[ -n ${SERVERMODS} ]] && [[ ${SERVERMODS} != *\; ]]; then + allMods="${SERVERMODS};" +else + allMods=${SERVERMODS} +fi +allMods+=$CLIENT_MODS # Add all client-side mods to the master mod list +CLIENT_MODS=$(RemoveDuplicates ${CLIENT_MODS}) # Remove duplicate mods from CLIENT_MODS, if present +allMods=$(RemoveDuplicates ${allMods}) # Remove duplicate mods from allMods, if present +allMods=$(echo $allMods | sed -e 's/;/ /g') # Convert from string to array + +# Update everything (server and mods), if specified +if [[ ${UPDATE_SERVER} == 1 ]]; then + echo -e "\n${GREEN}[STARTUP]: ${CYAN}Starting checks for all updates...${NC}" + echo -e "(It is okay to ignore any \"SDL\" and \"thread priority\" errors during this process)\n" + + ## Update game server + echo -e "${GREEN}[UPDATE]:${NC} Checking for game server updates with App ID: ${CYAN}${STEAMCMD_APPID}${NC}..." + + if [[ ${VALIDATE_SERVER} == 1 ]]; then # Validate will be added as a parameter if specified + echo -e "\t${CYAN}File validation enabled.${NC} (This may take extra time to complete)" + validateServer="validate" + else + validateServer="" + fi + + # Determine what extra flags should be set + if [[ -n ${STEAMCMD_EXTRA_FLAGS} ]]; then + echo -e "\t(${YELLOW}Advanced${NC}) Extra SteamCMD flags specified: ${CYAN}${STEAMCMD_EXTRA_FLAGS}${NC}\n" + extraFlags=${STEAMCMD_EXTRA_FLAGS} + else + echo -e "" + extraFlags="" + fi + + RunSteamCMD 0 ${STEAMCMD_APPID} + + ## Update mods + if [[ -n $allMods ]] && [[ ${DISABLE_MOD_UPDATES} != 1 ]]; then + echo -e "\n${GREEN}[UPDATE]:${NC} Checking all ${CYAN}Steam Workshop mods${NC} for updates..." + for modID in $(echo $allMods | sed -e 's/@//g') + do + if [[ $modID =~ ^[0-9]+$ ]]; then # Only check mods that are in ID-form + # Get mod's latest update in epoch time from its Steam Workshop changelog page + latestUpdate=$(curl -sL https://steamcommunity.com/sharedfiles/filedetails/changelog/$modID | grep '
$(find @$modID | head -1 | xargs stat -c%Y) ) ]]; then + # Get the mod's name from the Workshop page as well + modName=$(curl -sL https://steamcommunity.com/sharedfiles/filedetails/changelog/$modID | grep 'workshopItemTitle' | cut -d'>' -f2 | cut -d'<' -f1) + if [[ -z $modName ]]; then # Set default name if unavailable + modName="[NAME UNAVAILABLE]" + fi + if [[ ! -d @$modID ]]; then + echo -e "\n${GREEN}[UPDATE]:${NC} Downloading new Mod: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" + else + echo -e "\n${GREEN}[UPDATE]:${NC} Mod update found for: \"${CYAN}${modName}${NC}\" (${CYAN}${modID}${NC})" + fi + if [[ -n $latestUpdate ]] && [[ $latestUpdate =~ ^[0-9]+$ ]]; then # Notify last update date, if valid + echo -e "\tMod was last updated: ${CYAN}$(date -d @${latestUpdate})${NC}" + fi + + # Delete SteamCMD appworkshop cache before running to avoid mod download failures + echo -e "\tClearing SteamCMD appworkshop cache..." + rm -f ${WORKSHOP_DIR}/appworkshop_$GAME_ID.acf + + echo -e "\tAttempting mod update/download via SteamCMD...\n" + RunSteamCMD 1 $modID + fi + fi + done + echo -e "${GREEN}[UPDATE]:${NC} Steam Workshop mod update check ${GREEN}complete${NC}!" + fi +fi + +# Check if specified server binary exists. +if [[ ! -f ./${SERVER_BINARY} ]]; then + echo -e "\n${RED}[STARTUP_ERR]: Specified DayZ server binary could not be found in the root directory!${NC}" + echo -e "${YELLOW}Please do the following to resolve this issue:${NC}" + echo -e "\t${CYAN}- Double check your \"Server Binary\" Startup Variable is correct.${NC}" + echo -e "\t${CYAN}- Ensure your server has properly installed/updated without errors (reinstalling/updating again may help).${NC}" + echo -e "\t${CYAN}- Use the File Manager to check that your specified server binary file is not missing from the root directory.${NC}\n" + exit 1 +fi + +# Make mods lowercase, if specified +if [[ ${MODS_LOWERCASE} == "1" ]]; then + for modDir in $allMods + do + ModsLowercase $modDir + done +fi + +# Setup NSS Wrapper for use ($NSS_WRAPPER_PASSWD and $NSS_WRAPPER_GROUP have been set by the Dockerfile) +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +envsubst < /passwd.template > ${NSS_WRAPPER_PASSWD} +export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss_wrapper.so + +# Replace Startup Variables +modifiedStartup=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` + +# Start the Server +echo -e "\n${GREEN}[STARTUP]:${NC} Starting server with the following startup command:" +echo -e "${CYAN}${modifiedStartup}${NC}\n" +${modifiedStartup} + +if [ $? -ne 0 ]; then + echo -e "\n${RED}[STARTUP_ERR]: There was an error while attempting to run the start command.${NC}\n" + exit 1 +fi diff --git a/games/dayz/passwd.template b/games/dayz/passwd.template new file mode 100644 index 0000000..2b0dd45 --- /dev/null +++ b/games/dayz/passwd.template @@ -0,0 +1,26 @@ +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin +bin:x:2:2:bin:/bin:/usr/sbin/nologin +sys:x:3:3:sys:/dev:/usr/sbin/nologin +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/usr/sbin/nologin +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin +systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false +systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false +systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false +systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false +syslog:x:104:108::/home/syslog:/bin/false +messagebus:x:106:109::/var/run/dbus:/bin/false +bind:x:108:112::/var/cache/bind:/bin/false +${USER}:x:${USER_ID}:${GROUP_ID}:${USER}:${HOME}:/bin/bash \ No newline at end of file diff --git a/games/minetest/Dockerfile b/games/minetest/Dockerfile new file mode 100644 index 0000000..8f75208 --- /dev/null +++ b/games/minetest/Dockerfile @@ -0,0 +1,16 @@ +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y curl ca-certificates openssl git tar gnupg2 sqlite3 fontconfig tzdata iproute2 libfreetype6 software-properties-common \ + && useradd -d /home/container -m container + +RUN add-apt-repository -y ppa:minetestdevs/stable +RUN apt update && apt -y install minetest + +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/games/minetest/entrypoint.sh b/games/minetest/entrypoint.sh new file mode 100644 index 0000000..505b263 --- /dev/null +++ b/games/minetest/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# 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 minetest version +printf "\033[1m\033[33mcontainer@pelican~ \033[0mminetest --version\n" +minetest --version + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} \ No newline at end of file diff --git a/games/mohaa/Dockerfile b/games/mohaa/Dockerfile new file mode 100644 index 0000000..353d28e --- /dev/null +++ b/games/mohaa/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Manuel Dielacher" maintainer="th3dilli@gmx.at" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN dpkg --add-architecture i386 \ + && apt update && apt upgrade -y \ + && apt install -y lib32gcc-s1 lib32stdc++6 libstdc++5:i386 + + diff --git a/games/mohaa/entrypoint.sh b/games/mohaa/entrypoint.sh new file mode 100644 index 0000000..11acd70 --- /dev/null +++ b/games/mohaa/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# 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 +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/games/mta/Dockerfile b/games/mta/Dockerfile new file mode 100644 index 0000000..509fdd8 --- /dev/null +++ b/games/mta/Dockerfile @@ -0,0 +1,23 @@ +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive + +## add container user +RUN useradd -m -d /home/container -s /bin/bash container + +## update base packages +RUN apt update \ + && apt upgrade -y + +## install dependencies +RUN apt install -y iproute2 tar libssl1.1 curl git default-libmysqlclient-dev libmysqlclient-dev libreadline-gplv2-dev libncurses5-dev libncursesw5-dev \ + libtool zip unzip libncurses5 libncursesw5 python3 openssl locales ffmpeg apt-transport-https libc6 binutils xz-utils liblua5.1-0 + +## configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/games/mta/entrypoint.sh b/games/mta/entrypoint.sh new file mode 100644 index 0000000..7ed5b28 --- /dev/null +++ b/games/mta/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} \ No newline at end of file diff --git a/games/rust/Dockerfile b/games/rust/Dockerfile index 03295e5..ace5eea 100644 --- a/games/rust/Dockerfile +++ b/games/rust/Dockerfile @@ -1,50 +1,41 @@ -# -# Copyright (c) 2021 Pterodactyl -# -# 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. -# +FROM node:22-slim -FROM --platform=$TARGETOS/$TARGETARCH debian:bullseye-slim - -LABEL author="Isaac A." maintainer="isaac@isaacs.site" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -ENV DEBIAN_FRONTEND=noninteractive +ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 \ && apt update \ - && apt upgrade -y \ - && apt install -y lib32gcc-s1 lib32stdc++6 unzip curl iproute2 tzdata libgdiplus libsdl2-2.0-0:i386 \ - && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && apt install -y nodejs \ - && mkdir /node_modules \ - && npm install --prefix / ws \ - && useradd -d /home/container -m container + && apt upgrade -y -USER container -ENV USER=container HOME=/home/container +RUN apt install -y \ + lib32gcc-s1 \ + lib32stdc++6 \ + locales \ + unzip \ + curl \ + iproute2 \ + tzdata \ + libgdiplus \ + libsdl2-2.0-0:i386 + +RUN mkdir /wrapper \ + && npm install --prefix /wrapper ws + +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container WORKDIR /home/container COPY ./entrypoint.sh /entrypoint.sh -COPY ./wrapper.js /wrapper.js +COPY --chown=container:container ./wrapper.js /wrapper/wrapper.js +RUN chmod +x /wrapper/wrapper.js CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/games/rust/entrypoint.sh b/games/rust/entrypoint.sh index d817953..b9ca5f4 100644 --- a/games/rust/entrypoint.sh +++ b/games/rust/entrypoint.sh @@ -1,31 +1,46 @@ #!/bin/bash -cd /home/container -# Make internal Docker IP address available to processes. -export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'` +# Wait for the container to fully initialize +sleep 1 +# 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 ## if auto_update is not set or to 1 update if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then - ./steamcmd/steamcmd.sh +force_install_dir /home/container +login anonymous +app_update 258550 +quit + # Allow for the staging branch to also update itself + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login anonymous +app_update 258550 $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) +quit else echo -e "Not updating game server as auto update was set to 0. Starting Server" fi # Replace Startup Variables -MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +MODIFIED_STARTUP=$(eval echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo ":/home/container$ ${MODIFIED_STARTUP}" if [[ "${FRAMEWORK}" == "carbon" ]]; then - # Carbon: https://github.com/CarbonCommunity/Carbon.Core + # Carbon: https://github.com/CarbonCommunity/Carbon echo "Updating Carbon..." - curl -sSL "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Linux.Release.tar.gz" | tar zx + curl -sSL "https://github.com/CarbonCommunity/Carbon/releases/download/production_build/Carbon.Linux.Release.tar.gz" | tar zx echo "Done updating Carbon!" export DOORSTOP_ENABLED=1 export DOORSTOP_TARGET_ASSEMBLY="$(pwd)/carbon/managed/Carbon.Preloader.dll" MODIFIED_STARTUP="LD_PRELOAD=$(pwd)/libdoorstop.so ${MODIFIED_STARTUP}" - +elif [[ "${FRAMEWORK}" == "oxide-staging" ]]; then + echo "updating oxide-staging" + curl -sSL -o oxide-staging.zip "https://downloads.oxidemod.com/artifacts/Oxide.Rust/staging/Oxide.Rust-linux.zip" + unzip -o -q oxide-staging.zip + rm oxide-staging.zip + echo "Done updating oxide Staging" elif [[ "$OXIDE" == "1" ]] || [[ "${FRAMEWORK}" == "oxide" ]]; then # Oxide: https://github.com/OxideMod/Oxide.Rust echo "Updating uMod..." @@ -40,4 +55,4 @@ fi export LD_LIBRARY_PATH=$(pwd)/RustDedicated_Data/Plugins/x86_64:$(pwd) # Run the Server -node /wrapper.js "${MODIFIED_STARTUP}" +/wrapper/wrapper.js "${MODIFIED_STARTUP}" diff --git a/games/rust/wrapper.js b/games/rust/wrapper.js index 1d807a9..f4f6cc5 100644 --- a/games/rust/wrapper.js +++ b/games/rust/wrapper.js @@ -137,4 +137,4 @@ var poll = function () { } }); } -poll(); +poll(); \ No newline at end of file diff --git a/games/samp/Dockerfile b/games/samp/Dockerfile new file mode 100644 index 0000000..33f6dce --- /dev/null +++ b/games/samp/Dockerfile @@ -0,0 +1,33 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="QuintenQVD" maintainer="josdekurk@gmail.com" + +RUN apt update \ + && apt -y upgrade +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt install -y libstdc++6 lib32stdc++6 tar wget curl iproute2 openssl fontconfig dirmngr ca-certificates dnsutils tzdata zip tini \ + && apt install -y libtbb12:i386 libtbb-dev:i386 libicu-dev:i386 \ + && useradd -d /home/container -m container + +RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container +RUN rm -rf /var/lib/apt/lists/* + + # Temp fix for things that still need libssl1.1 32 bit +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_i386.deb && \ + dpkg -i libssl1.1_1.1.0g-2ubuntu4_i386.deb && \ + rm libssl1.1_1.1.0g-2ubuntu4_i386.deb; \ + fi + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/samp/entrypoint.sh b/games/samp/entrypoint.sh new file mode 100644 index 0000000..6dda5e5 --- /dev/null +++ b/games/samp/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'` + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/games/source/Dockerfile b/games/source/Dockerfile index e8a9cb1..699770a 100644 --- a/games/source/Dockerfile +++ b/games/source/Dockerfile @@ -20,7 +20,7 @@ # SOFTWARE. # -FROM --platform=$TARGETOS/$TARGETARCH debian:stable-slim +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" @@ -30,14 +30,31 @@ LABEL org.opencontainers.image.licenses=MIT ENV DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 \ - && apt update \ - && apt upgrade -y \ - && apt install -y tar curl gcc g++ lib32gcc-s1 libgcc1 libcurl4-gnutls-dev:i386 libssl3:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat-traditional tzdata \ - && useradd -m -d /home/container container + && apt update \ + && apt upgrade -y \ + && apt install -y tar curl gcc g++ lib32gcc-s1 libgcc-11-dev libgcc-12-dev libcurl4-gnutls-dev:i386 libssl-dev:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat-traditional tzdata numactl wget tini \ + && useradd -m -d /home/container container +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + + # Temp fix for things that still need libssl1.1 +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \ + fi + USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/source/entrypoint.sh b/games/source/entrypoint.sh index ae6363c..8562f11 100644 --- a/games/source/entrypoint.sh +++ b/games/source/entrypoint.sh @@ -22,7 +22,7 @@ # SOFTWARE. # -# Give everything time to initialize for preventing SteamCMD deadlock +# Wait for the container to fully initialize sleep 1 # Default the TZ environment variable to UTC. @@ -36,10 +36,6 @@ export INTERNAL_IP # Switch to the container's working directory cd /home/container || exit 1 -# 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 -)") ## just in case someone removed the defaults. if [ "${STEAM_USER}" == "" ]; then @@ -53,10 +49,14 @@ else fi ## if auto_update is not set or to 1 update -if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then +if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then # Update Source Server if [ ! -z ${SRCDS_APPID} ]; then - ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + if [ "${STEAM_USER}" == "anonymous" ]; then + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + else + numactl --physcpubind=+0 ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + fi else echo -e "No appid set. Starting Server" fi @@ -65,8 +65,9 @@ else echo -e "Not updating game server as auto update was set to 0. Starting Server" fi -# 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 -exec env ${PARSED} +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/games/thebattleforwesnoth/Dockerfile b/games/thebattleforwesnoth/Dockerfile new file mode 100644 index 0000000..d1c33ce --- /dev/null +++ b/games/thebattleforwesnoth/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +## update base packages +RUN apt update && apt upgrade -y + +## install dependencies +RUN apt install -y gcc g++ libgcc1 libc++-dev gdb libc6 git tar zip unzip libssl-dev tini iproute2 \ + libboost-filesystem-dev libboost-iostreams-dev libboost-locale-dev libboost-random-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-coroutine-dev libboost-graph-dev \ + libsdl2-dev libcurl4-openssl-dev libcairo2-dev libvorbis-dev libbz2-dev zlib1g-dev libssl-dev libcrypto++-dev openssl cmake libsdl2-image-dev libsdl2-mixer-dev libsdl-pango-dev + + +## add container user +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/thebattleforwesnoth/entrypoint.sh b/games/thebattleforwesnoth/entrypoint.sh new file mode 100644 index 0000000..461e6b9 --- /dev/null +++ b/games/thebattleforwesnoth/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/games/valheim/Dockerfile b/games/valheim/Dockerfile new file mode 100644 index 0000000..f6c20b5 --- /dev/null +++ b/games/valheim/Dockerfile @@ -0,0 +1,42 @@ +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:22.04 + +LABEL author="Daniel Barton" maintainer="danny6167@gmail.com" + +ENV DEBIAN_FRONTEND=noninteractive + +## add container user +RUN useradd -m -d /home/container -s /bin/bash container + + + +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt install -y libcurl4-gnutls-dev:i386 libssl3:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 \ + gcc g++ libgcc1 libc++-dev gdb libc6 curl tar iproute2 net-tools libatomic1 libsdl1.2debian libsdl2-2.0-0 \ + libfontconfig locales libcurl3-gnutls libpulse-dev libpulse0 libnss-wrapper gettext tini + +## configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + + +ENV USER=container HOME=/home/container +WORKDIR /home/container + + + +## Prepare NSS Wrapper for the entrypoint as a workaround for Valheim requiring a valid UID +ENV NSS_WRAPPER_PASSWD=/tmp/passwd NSS_WRAPPER_GROUP=/tmp/group +RUN touch ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ + && chgrp 0 ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} \ + && chmod g+rw ${NSS_WRAPPER_PASSWD} ${NSS_WRAPPER_GROUP} +ADD passwd.template /passwd.template + + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/valheim/entrypoint.sh b/games/valheim/entrypoint.sh new file mode 100644 index 0000000..9bfe451 --- /dev/null +++ b/games/valheim/entrypoint.sh @@ -0,0 +1,46 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + + +## just in case someone removed the defaults. +if [ "${STEAM_USER}" == "" ]; then + echo -e "steam user is not set.\n" + echo -e "Using anonymous user.\n" + STEAM_USER=anonymous + STEAM_PASS="" + STEAM_AUTH="" +else + echo -e "user set to ${STEAM_USER}" +fi + +## if auto_update is not set or to 1 update +if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then + # Update Source Server + if [ ! -z ${SRCDS_APPID} ]; then + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + else + echo -e "No appid set. Starting Server" + fi + +else + echo -e "Not updating game server as auto update was set to 0. Starting Server" +fi + + +# Setup NSS Wrapper for use ($NSS_WRAPPER_PASSWD and $NSS_WRAPPER_GROUP have been set by the Dockerfile) +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +envsubst < /passwd.template > ${NSS_WRAPPER_PASSWD} + +export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss_wrapper.so + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/games/valheim/passwd.template b/games/valheim/passwd.template new file mode 100644 index 0000000..d14bace --- /dev/null +++ b/games/valheim/passwd.template @@ -0,0 +1,26 @@ +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin +bin:x:2:2:bin:/bin:/usr/sbin/nologin +sys:x:3:3:sys:/dev:/usr/sbin/nologin +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/usr/sbin/nologin +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin +irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin +gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin +nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin +systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false +systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false +systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false +systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false +syslog:x:104:108::/home/syslog:/bin/false +messagebus:x:106:109::/var/run/dbus:/bin/false +bind:x:108:112::/var/cache/bind:/bin/false +${USER_NAME}:x:${USER_ID}:${GROUP_ID}:${USER_NAME}:${HOME}:/bin/bash diff --git a/go/1.16/entrypoint.sh b/go/1.16/entrypoint.sh deleted file mode 100644 index 7adafec..0000000 --- a/go/1.16/entrypoint.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/ash - -# -# 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 Go version -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mgo version\n" -go 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 -exec env ${PARSED} diff --git a/go/1.17/Dockerfile b/go/1.17/Dockerfile index 9f3d30d..522c443 100644 --- a/go/1.17/Dockerfile +++ b/go/1.17/Dockerfile @@ -28,7 +28,7 @@ LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolk LABEL org.opencontainers.image.licenses=MIT RUN apk add --update --no-cache ca-certificates tzdata \ - && adduser -D -h /home/container container + && adduser -D -h /home/container container USER container ENV USER=container HOME=/home/container diff --git a/go/1.16/Dockerfile.temp b/go/1.18/Dockerfile similarity index 96% rename from go/1.16/Dockerfile.temp rename to go/1.18/Dockerfile index c749182..be01868 100644 --- a/go/1.16/Dockerfile.temp +++ b/go/1.18/Dockerfile @@ -20,7 +20,7 @@ # SOFTWARE. # -FROM golang:1.16-alpine +FROM --platform=$TARGETOS/$TARGETARCH golang:1.18-alpine LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" diff --git a/nodejs/15/Dockerfile b/go/1.19/Dockerfile similarity index 90% rename from nodejs/15/Dockerfile rename to go/1.19/Dockerfile index c243712..d838bb8 100644 --- a/nodejs/15/Dockerfile +++ b/go/1.19/Dockerfile @@ -20,14 +20,14 @@ # SOFTWARE. # -FROM --platform=$TARGETOS/$TARGETARCH node:15-alpine +FROM --platform=$TARGETOS/$TARGETARCH golang:1.19-alpine LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ +RUN apk add --update --no-cache ca-certificates tzdata \ && adduser -D -h /home/container container USER container diff --git a/java/18/Dockerfile b/go/1.20/Dockerfile similarity index 81% rename from java/18/Dockerfile rename to go/1.20/Dockerfile index 5698b0e..7023ba6 100644 --- a/java/18/Dockerfile +++ b/go/1.20/Dockerfile @@ -20,20 +20,19 @@ # SOFTWARE. # -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:18-jdk-jammy +FROM --platform=$TARGETOS/$TARGETARCH golang:1.20-alpine LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apk add --update --no-cache ca-certificates tzdata \ + && adduser -D -h /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/java/17j9/Dockerfile b/go/1.21/Dockerfile similarity index 81% rename from java/17j9/Dockerfile rename to go/1.21/Dockerfile index 3bec1ec..03d96c4 100644 --- a/java/17j9/Dockerfile +++ b/go/1.21/Dockerfile @@ -20,20 +20,19 @@ # SOFTWARE. # -FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-17-jdk +FROM --platform=$TARGETOS/$TARGETARCH golang:1.21-alpine LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apk add --update --no-cache ca-certificates tzdata \ + && adduser -D -h /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/go/1.22/Dockerfile b/go/1.22/Dockerfile new file mode 100644 index 0000000..a6c7d15 --- /dev/null +++ b/go/1.22/Dockerfile @@ -0,0 +1,38 @@ +# +# 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. +# + +FROM --platform=$TARGETOS/$TARGETARCH golang:1.22-alpine + +LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache ca-certificates tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/go/1.23/Dockerfile b/go/1.23/Dockerfile new file mode 100644 index 0000000..df237ca --- /dev/null +++ b/go/1.23/Dockerfile @@ -0,0 +1,12 @@ +FROM --platform=$TARGETOS/$TARGETARCH golang:1.23-alpine + + +RUN apk add --update --no-cache ca-certificates tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/go/entrypoint.sh b/go/entrypoint.sh index 7adafec..5de2ba6 100644 --- a/go/entrypoint.sh +++ b/go/entrypoint.sh @@ -34,16 +34,16 @@ export INTERNAL_IP cd /home/container || exit 1 # Print Go version -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mgo version\n" +printf "\033[1m\033[33mcontainer@pelican~ \033[0mgo version\n" go 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 -)") +PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g') -# 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" +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" # shellcheck disable=SC2086 -exec env ${PARSED} +eval "$PARSED" diff --git a/installall.sh b/installall.sh index 29f5cf8..5d9d782 100644 --- a/installall.sh +++ b/installall.sh @@ -4,41 +4,136 @@ REGISTRY="git.eplg.services" NAMESPACE="pterodactylimages" DIRS=( + "apps/uptimekuma" + "bot/bastion" + "bot/parkertron" + "bot/red" + "bot/sinusbot" + "box64" + "bun/canary" + "bun/latest" + "cassandra/java11_python3" + "cassandra/java8_python2" + "dart/2.17" + "dart/2.18" + "dart/2.19" + "dart/3.3" + "dart/stable" + "dotnet/2.1" + "dotnet/3.1" + "dotnet/5" + "dotnet/6" + "dotnet/7" + "dotnet/8" + "dotnet/9" + "elixir/1.12" + "elixir/1.13" + "elixir/1.14" + "elixir/1.15" + "elixir/latest" + "erlang/22" + "erlang/23" + "erlang/24" + "erlang/25" + "erlang/26" + "games/altv" + "games/arma3" + "games/dayz" + "games/minetest" + "games/mohaa" + "games/mta" "games/rust" + "games/samp" "games/source" + "games/thebattleforwesnoth" + "games/valheim" "go/1.14" "go/1.15" "go/1.16" "go/1.17" + "go/1.18" + "go/1.19" + "go/1.20" + "go/1.21" + "go/1.22" + "go/1.23" "installers/alpine" "installers/debian" - "java/8" - "java/8j9" + "installers/ubuntu" "java/11" "java/11j9" "java/16" "java/16j9" "java/17" - "java/17j9" - "java/18" - "java/18j9" "java/19" - "java/19j9" "java/21" + "java/22" + "java/8" + "java/8j9" + "mariadb/10.3" + "mariadb/10.4" + "mariadb/10.5" + "mariadb/10.6" + "mariadb/10.7" + "mariadb/11.2" + "mariadb/11.3" + "mariadb/11.4" + "mariadb/11.5" + "mariadb/11.6" + "mongodb/4" + "mongodb/5" + "mongodb/6" + "mongodb/7" + "mono/latest" "nodejs/12" "nodejs/14" - "nodejs/15" "nodejs/16" "nodejs/17" "nodejs/18" + "nodejs/19" "nodejs/20" + "nodejs/21" + "nodejs/22" + "nodejs/23" "oses/alpine" "oses/debian" + "oses/ubuntu" + "postgres/10" + "postgres/11" + "postgres/12" + "postgres/13" + "postgres/14" + "postgres/16" + "postgres/9" + "python/2.7" + "python/3.10" + "python/3.11" + "python/3.12" + "python/3.13" "python/3.7" "python/3.8" "python/3.9" - "python/3.10" - "python/3.11" + "redis/5" + "redis/6" + "redis/7" + "rust/1.56" + "rust/1.60" + "rust/latest" + "steamcmd/debian" + "steamcmd/dotnet" + "steamcmd/proton" + "steamcmd/proton_8" + "steamcmd/sniper" + "steamcmd/ubuntu" + "voice/mumble" + "voice/teaspeak" + "wine/10" + "wine/7" + "wine/8" + "wine/9" + "wine/devel" + "wine/latest" + "wine/staging" ) for DIR in "${DIRS[@]}"; do diff --git a/installers/alpine/Dockerfile b/installers/alpine/Dockerfile index a5b6b81..6ecc6cb 100644 --- a/installers/alpine/Dockerfile +++ b/installers/alpine/Dockerfile @@ -27,4 +27,4 @@ LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apk add --update --no-cache ca-certificates curl git jq wget +RUN apk add --update --no-cache ca-certificates curl unzip tar git jq wget diff --git a/installers/debian/Dockerfile b/installers/debian/Dockerfile index 658b13e..71ab96e 100644 --- a/installers/debian/Dockerfile +++ b/installers/debian/Dockerfile @@ -20,7 +20,7 @@ # SOFTWARE. # -FROM --platform=$TARGETOS/$TARGETARCH debian:bullseye-slim +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" @@ -29,7 +29,12 @@ LABEL org.opencontainers.image.licenses=MIT ENV DEBIAN_FRONTEND=noninteractive -RUN dpkg --add-architecture i386 \ - && apt update \ - && apt upgrade -y \ - && apt -y --no-install-recommends install ca-certificates curl lib32gcc-s1 libsdl2-2.0-0:i386 git wget +RUN apt update && apt upgrade -y \ + && apt -y --no-install-recommends install ca-certificates curl git unzip zip tar jq wget + +# Only install the needed steamcmd packages on the AMD64 build +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + dpkg --add-architecture i386 && \ + apt update && \ + apt -y install lib32gcc-s1 libsdl2-2.0-0:i386; \ + fi \ No newline at end of file diff --git a/installers/ubuntu/Dockerfile b/installers/ubuntu/Dockerfile new file mode 100644 index 0000000..bcfa60b --- /dev/null +++ b/installers/ubuntu/Dockerfile @@ -0,0 +1,34 @@ +# +# Copyright (c) 2022 oliver194 +# +# 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. +# + +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:jammy + +LABEL author="oliver194" maintainer="100048880+oliver194@users.noreply.github.com" + +LABEL org.opencontainers.image.source="https://github.com/oliver194/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update \ + && apt upgrade -y \ + && apt -y --no-install-recommends install ca-certificates curl git unzip zip tar jq diff --git a/java/11/Dockerfile b/java/11/Dockerfile index 9efc5ba..468b7e2 100644 --- a/java/11/Dockerfile +++ b/java/11/Dockerfile @@ -1,47 +1,37 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:11-jdk-noble -# Hard coded specific Java version to fix issue with manifest constructor class in -# newer Java versions breaking all modpacks and versions that are not using the -# latest Forge release. This should be removed when the manifest constructor class -# issue is backported or if Forge decides to abandon old versions and we need -# newer Java versions. Old Quay images were updated like once a year, so it's ok. -# -# @see https://github.com/McModLauncher/modlauncher/issues/91 - -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:11.0.13_8-jdk-focal - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/11j9/Dockerfile b/java/11j9/Dockerfile index 4454341..6098eb9 100644 --- a/java/11j9/Dockerfile +++ b/java/11j9/Dockerfile @@ -1,39 +1,33 @@ -# -# 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. -# - FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-11-jdk -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/16/Dockerfile b/java/16/Dockerfile index 1c904bd..139721e 100644 --- a/java/16/Dockerfile +++ b/java/16/Dockerfile @@ -1,40 +1,36 @@ -# -# 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. -# - FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:16-jdk-focal - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/16j9/Dockerfile b/java/16j9/Dockerfile index 0f5632e..e26b6d8 100644 --- a/java/16j9/Dockerfile +++ b/java/16j9/Dockerfile @@ -1,39 +1,34 @@ -# -# 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. -# - FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-16-jdk -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] + diff --git a/java/17/Dockerfile b/java/17/Dockerfile index a55fe0f..02db317 100644 --- a/java/17/Dockerfile +++ b/java/17/Dockerfile @@ -1,39 +1,36 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-noble -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-jammy - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/18j9/Dockerfile b/java/18j9/Dockerfile deleted file mode 100644 index b83df45..0000000 --- a/java/18j9/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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. -# - -FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-18-jdk - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && 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" ] diff --git a/java/19/Dockerfile b/java/19/Dockerfile index f4e2f1e..5d847b0 100644 --- a/java/19/Dockerfile +++ b/java/19/Dockerfile @@ -1,39 +1,36 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:19-jdk-focal -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:19-jdk-jammy - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/19j9/Dockerfile b/java/19j9/Dockerfile deleted file mode 100644 index 8f818c5..0000000 --- a/java/19j9/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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. -# - -FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-19-jdk - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && 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" ] diff --git a/java/21/Dockerfile b/java/21/Dockerfile index 6dba24a..f6a94d9 100644 --- a/java/21/Dockerfile +++ b/java/21/Dockerfile @@ -1,39 +1,36 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:21-jdk-noble -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:21-jdk - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/22/Dockerfile b/java/22/Dockerfile new file mode 100644 index 0000000..cd96137 --- /dev/null +++ b/java/22/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:22-jdk-noble + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/8/Dockerfile b/java/8/Dockerfile index 2aee00a..758eef7 100644 --- a/java/8/Dockerfile +++ b/java/8/Dockerfile @@ -1,47 +1,36 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:8-jdk-noble -# Hard coded specific Java version to fix issue with manifest constructor class in -# newer Java versions breaking all modpacks and versions that are not using the -# latest Forge release. This should be removed when the manifest constructor class -# issue is backported or if Forge decides to abandon old versions and we need -# newer Java versions. Old Quay images were updated like once a year, so it's ok. -# -# @see https://github.com/McModLauncher/modlauncher/issues/91 - -FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:8u312-b07-jdk-focal - -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/8j9/Dockerfile b/java/8j9/Dockerfile index 77d5348..5843a20 100644 --- a/java/8j9/Dockerfile +++ b/java/8j9/Dockerfile @@ -1,39 +1,33 @@ -# -# 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. -# - FROM --platform=$TARGETOS/$TARGETARCH ibm-semeru-runtimes:open-8-jdk -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apt-get update -y \ - && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ - && useradd -d /home/container -m container +RUN apt update -y \ + && apt install -y \ + curl \ + lsof \ + ca-certificates \ + openssl \ + git \ + tar \ + sqlite3 \ + fontconfig \ + tzdata \ + iproute2 \ + libfreetype6 \ + tini \ + zip \ + unzip +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/java/entrypoint.sh b/java/entrypoint.sh index a081cc4..23b662a 100644 --- a/java/entrypoint.sh +++ b/java/entrypoint.sh @@ -34,16 +34,16 @@ export INTERNAL_IP cd /home/container || exit 1 # Print Java version -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n" +printf "\033[1m\033[33mcontainer@pelican~ \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 -)") +PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g') -# 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" +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" # shellcheck disable=SC2086 -exec env ${PARSED} +eval "$PARSED" diff --git a/mariadb/10.3/Dockerfile b/mariadb/10.3/Dockerfile new file mode 100644 index 0000000..1c9db09 --- /dev/null +++ b/mariadb/10.3/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.3 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.4/Dockerfile b/mariadb/10.4/Dockerfile new file mode 100644 index 0000000..37e42d9 --- /dev/null +++ b/mariadb/10.4/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.4 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.5/Dockerfile b/mariadb/10.5/Dockerfile new file mode 100644 index 0000000..ab7d5be --- /dev/null +++ b/mariadb/10.5/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.5 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.6/Dockerfile b/mariadb/10.6/Dockerfile new file mode 100644 index 0000000..60f3939 --- /dev/null +++ b/mariadb/10.6/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.6 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/10.7/Dockerfile b/mariadb/10.7/Dockerfile new file mode 100644 index 0000000..d514c83 --- /dev/null +++ b/mariadb/10.7/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:10.7 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/11.2/Dockerfile b/mariadb/11.2/Dockerfile new file mode 100644 index 0000000..b3398ed --- /dev/null +++ b/mariadb/11.2/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:11.2 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/11.3/Dockerfile b/mariadb/11.3/Dockerfile new file mode 100644 index 0000000..535e523 --- /dev/null +++ b/mariadb/11.3/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:11.3 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/11.4/Dockerfile b/mariadb/11.4/Dockerfile new file mode 100644 index 0000000..d4b2293 --- /dev/null +++ b/mariadb/11.4/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:11.4 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat-traditional \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/11.5/Dockerfile b/mariadb/11.5/Dockerfile new file mode 100644 index 0000000..fd571fb --- /dev/null +++ b/mariadb/11.5/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:11.5 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat-traditional \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/11.6/Dockerfile b/mariadb/11.6/Dockerfile new file mode 100644 index 0000000..ec0a23a --- /dev/null +++ b/mariadb/11.6/Dockerfile @@ -0,0 +1,19 @@ +# ----------------------------------------------------- +# MariaDB Image for Pterodactyl +# ----------------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mariadb:11.6 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat-traditional \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mariadb/entrypoint.sh b/mariadb/entrypoint.sh new file mode 100644 index 0000000..d3884d4 --- /dev/null +++ b/mariadb/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/mongodb/4/Dockerfile b/mongodb/4/Dockerfile new file mode 100644 index 0000000..bab5f3e --- /dev/null +++ b/mongodb/4/Dockerfile @@ -0,0 +1,19 @@ +# ---------------------------------- +# Environment: MongoDB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mongo:4-focal + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat iproute2 \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mongodb/5/Dockerfile b/mongodb/5/Dockerfile new file mode 100644 index 0000000..aeaf3c2 --- /dev/null +++ b/mongodb/5/Dockerfile @@ -0,0 +1,19 @@ +# ---------------------------------- +# Environment: MongoDB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mongo:5-focal + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat iproute2 \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mongodb/6/Dockerfile b/mongodb/6/Dockerfile new file mode 100644 index 0000000..b347e10 --- /dev/null +++ b/mongodb/6/Dockerfile @@ -0,0 +1,19 @@ +# ---------------------------------- +# Environment: MongoDB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mongo:6-jammy + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat iproute2 \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mongodb/7/Dockerfile b/mongodb/7/Dockerfile new file mode 100644 index 0000000..ee446e6 --- /dev/null +++ b/mongodb/7/Dockerfile @@ -0,0 +1,19 @@ +# ---------------------------------- +# Environment: MongoDB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH mongo:7-jammy + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update -y \ + && apt install -y netcat iproute2 \ + && useradd -d /home/container -m container -s /bin/bash + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/mongodb/entrypoint.sh b/mongodb/entrypoint.sh new file mode 100644 index 0000000..d3884d4 --- /dev/null +++ b/mongodb/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/mono/entrypoint.sh b/mono/entrypoint.sh new file mode 100644 index 0000000..2700f19 --- /dev/null +++ b/mono/entrypoint.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Wait for the container to fully initialize +sleep 1 + +# 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 + +if [ ! -z "${SRCDS_APPID}" ]; then + ## just in case someone removed the defaults. + if [ "${STEAM_USER}" == "" ]; then + echo -e "steam user is not set.\n" + echo -e "Using anonymous user.\n" + STEAM_USER=anonymous + STEAM_PASS="" + STEAM_AUTH="" + else + echo -e "user set to ${STEAM_USER}" + fi + + ## if auto_update is not set or to 1 update + if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then + # Update Source Server + if [ ! -z ${SRCDS_APPID} ]; then + if [ "${STEAM_USER}" == "anonymous" ]; then + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + else + numactl --physcpubind=+0 ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + fi + else + echo -e "No appid set. Starting Server" + fi + + else + echo -e "Not updating game server as auto update was set to 0. Starting Server" + fi +fi + + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/mono/latest/Dockerfile b/mono/latest/Dockerfile new file mode 100644 index 0000000..3e6a2b5 --- /dev/null +++ b/mono/latest/Dockerfile @@ -0,0 +1,26 @@ +FROM --platform=$TARGETOS/$TARGETARCH ghcr.io/parkervcp/yolks:debian + +LABEL author="Torsten Widmann" maintainer="support@goover.de" + +RUN apt update \ + && apt -y upgrade +RUN apt install -y fontconfig dirmngr numactl +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN sh -c 'echo "deb https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list' +RUN apt update +RUN apt install -y mono-complete + +# Only install the needed steamcmd packages on the AMD64 build +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + dpkg --add-architecture i386 && \ + apt update && \ + apt -y install lib32gcc-s1 libsdl2-2.0-0:i386; \ + fi + + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/nodejs/12/Dockerfile b/nodejs/12/Dockerfile index aaf5687..348c9fd 100644 --- a/nodejs/12/Dockerfile +++ b/nodejs/12/Dockerfile @@ -1,38 +1,20 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:12-bullseye-slim -FROM --platform=$TARGETOS/$TARGETARCH node:12-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/nodejs/14/Dockerfile b/nodejs/14/Dockerfile index a696cf3..c0d53ee 100644 --- a/nodejs/14/Dockerfile +++ b/nodejs/14/Dockerfile @@ -1,38 +1,20 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:14-bullseye-slim -FROM --platform=$TARGETOS/$TARGETARCH node:14-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/16/Dockerfile b/nodejs/16/Dockerfile index 3dc471e..ba417f9 100644 --- a/nodejs/16/Dockerfile +++ b/nodejs/16/Dockerfile @@ -1,38 +1,20 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:16-bookworm-slim -FROM --platform=$TARGETOS/$TARGETARCH node:16-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/17/Dockerfile b/nodejs/17/Dockerfile index 7d71011..e10a474 100644 --- a/nodejs/17/Dockerfile +++ b/nodejs/17/Dockerfile @@ -1,38 +1,20 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:17-bullseye-slim -FROM --platform=$TARGETOS/$TARGETARCH node:17-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN npm install npm@8.11.0 typescript ts-node @types/node --location=global USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/18/Dockerfile b/nodejs/18/Dockerfile index 8a0eaaf..ee3e920 100644 --- a/nodejs/18/Dockerfile +++ b/nodejs/18/Dockerfile @@ -1,38 +1,25 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:18-bookworm-slim -FROM --platform=$TARGETOS/$TARGETARCH node:18-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT +RUN npm install npm@10.x.x typescript ts-node @types/node --location=global -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/19/Dockerfile b/nodejs/19/Dockerfile new file mode 100644 index 0000000..c3f3b9d --- /dev/null +++ b/nodejs/19/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:19-bullseye-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container + +RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global + +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/20/Dockerfile b/nodejs/20/Dockerfile index 92aed70..691e8b2 100644 --- a/nodejs/20/Dockerfile +++ b/nodejs/20/Dockerfile @@ -1,38 +1,25 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH node:20-bookworm-slim -FROM --platform=$TARGETOS/$TARGETARCH node:20-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT +RUN npm install npm@latest typescript ts-node @types/node --location=global -RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/nodejs/21/Dockerfile b/nodejs/21/Dockerfile new file mode 100644 index 0000000..fd28e79 --- /dev/null +++ b/nodejs/21/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:21-bookworm-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container + +RUN npm install npm@10.x.x typescript ts-node @types/node --location=global + +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/22/Dockerfile b/nodejs/22/Dockerfile new file mode 100644 index 0000000..0ae0985 --- /dev/null +++ b/nodejs/22/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:22-bookworm-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container + + RUN npm install npm@latest typescript ts-node @types/node --location=global + +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/23/Dockerfile b/nodejs/23/Dockerfile new file mode 100644 index 0000000..5cb4278 --- /dev/null +++ b/nodejs/23/Dockerfile @@ -0,0 +1,25 @@ +FROM --platform=$TARGETOS/$TARGETARCH node:23-bookworm-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ + && useradd -m -d /home/container container + +RUN npm install npm@latest typescript ts-node @types/node --location=global + +# install pnpm +RUN npm install -g corepack +RUN corepack enable +RUN corepack prepare pnpm@latest --activate + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/nodejs/entrypoint.sh b/nodejs/entrypoint.sh index d96f46c..60c2279 100644 --- a/nodejs/entrypoint.sh +++ b/nodejs/entrypoint.sh @@ -1,49 +1,16 @@ -#!/bin/ash +#!/bin/bash +cd /home/container -# -# 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 +# Make internal Docker IP address available to processes. 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 Node.js version -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mnode -v\n" +# Print Node.js Version node -v -# 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 -)") +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" -# 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 -exec env ${PARSED} +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/oses/alpine/Dockerfile b/oses/alpine/Dockerfile index b7badc9..32eb44a 100644 --- a/oses/alpine/Dockerfile +++ b/oses/alpine/Dockerfile @@ -27,12 +27,16 @@ LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" LABEL org.opencontainers.image.licenses=MIT -RUN apk add --update --no-cache ca-certificates tzdata \ +RUN apk add --update --no-cache ca-certificates tzdata tini \ && adduser -D -h /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/oses/alpine/entrypoint.sh b/oses/alpine/entrypoint.sh index e156de6..2b81022 100644 --- a/oses/alpine/entrypoint.sh +++ b/oses/alpine/entrypoint.sh @@ -34,11 +34,11 @@ cd /home/container || exit 1 # 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 -)") +PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g') -# 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" +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" # shellcheck disable=SC2086 -exec env ${PARSED} +eval "$PARSED" diff --git a/oses/debian/Dockerfile b/oses/debian/Dockerfile index 2034266..c6d7fe0 100644 --- a/oses/debian/Dockerfile +++ b/oses/debian/Dockerfile @@ -1,23 +1,52 @@ -FROM --platform=$TARGETOS/$TARGETARCH debian:buster-slim +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT -RUN apt update && apt upgrade -y \ - && apt install -y gcc g++ libgcc1 libc++-dev gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ - libfontconfig libicu63 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadbclient-dev libduktape203 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates tzdata \ - liblua5.3 libz-dev rapidjson-dev \ - && update-locale lang=en_US.UTF-8 \ - && dpkg-reconfigure --frontend noninteractive locales \ - && useradd -m -d /home/container -s /bin/bash container +ENV DEBIAN_FRONTEND=noninteractive + +RUN useradd -m -d /home/container -s /bin/bash container + +RUN ln -s /home/container/ /nonexistent + +ENV USER=container HOME=/home/container + +## Update base packages +RUN apt update \ + && apt upgrade -y + +## Install dependencies +RUN apt install -y gcc g++ libgcc-12-dev libc++-dev gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat-traditional telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ + libfontconfig1 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadb-dev-compat libduktape207 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \ + liblua5.3-0 libz3-dev libzadc4 rapidjson-dev tzdata libevent-dev libzip4 libprotobuf32 libfluidsynth3 procps libstdc++6 tini + +# Temp fix for libicu66.1 for RAGE-MP and libssl1.1 for fivem and many more +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2.1_amd64.deb && \ + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + dpkg -i libicu66_66.1-2ubuntu2.1_amd64.deb && \ + dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + rm libicu66_66.1-2ubuntu2.1_amd64.deb libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \ + fi +# ARM64 +RUN if [ ! "$(uname -m)" = "x86_64" ]; then \ + wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \ + dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \ + rm libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \ + fi + +## Configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales -USER container -ENV USER=container HOME=/home/container -ENV DEBIAN_FRONTEND noninteractive WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/oses/debian/entrypoint.sh b/oses/debian/entrypoint.sh index 4637742..461e6b9 100644 --- a/oses/debian/entrypoint.sh +++ b/oses/debian/entrypoint.sh @@ -1,44 +1,13 @@ #!/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. -# +cd /home/container -# Default the TZ environment variable to UTC. -TZ=${TZ:-UTC} -export TZ - -# Set environment variable that holds the Internal Docker IP +# Make internal Docker IP address available to processes. 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 +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" -# 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 -exec env ${PARSED} +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/oses/ubuntu/Dockerfile b/oses/ubuntu/Dockerfile new file mode 100644 index 0000000..a4ea9e1 --- /dev/null +++ b/oses/ubuntu/Dockerfile @@ -0,0 +1,35 @@ +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:24.04 + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/pelican-eggs/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +## Add container user +RUN useradd -m -d /home/container -s /bin/bash container +ENV USER=container HOME=/home/container + +## Update base packages +RUN apt update \ + && apt upgrade -y + +## Install dependencies +RUN apt install -y gcc g++ libgcc1 libc++-dev gdb libc6 git wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat-openbsd telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \ + libfontconfig icu-devtools libunwind8 sqlite3 libsqlite3-dev libzip4 locales ffmpeg apt-transport-https init-system-helpers \ + libcurl3-gnutls liblua5.1-0 libluajit-5.1-2 libsqlite3-0 bzip2 zlib1g libevent-dev libmariadb-dev-compat libmariadb-dev libssl-dev \ + libfluidsynth-dev libmariadb-dev libicu-dev libssl3 libduktape207 libjsoncpp-dev libleveldb1d libncurses6 libncursesw6 tini + +## Configure locale +RUN update-locale lang=en_US.UTF-8 \ + && dpkg-reconfigure --frontend noninteractive locales + +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/oses/ubuntu/entrypoint.sh b/oses/ubuntu/entrypoint.sh new file mode 100644 index 0000000..461e6b9 --- /dev/null +++ b/oses/ubuntu/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/postgres/10/Dockerfile b/postgres/10/Dockerfile new file mode 100644 index 0000000..3cbd93b --- /dev/null +++ b/postgres/10/Dockerfile @@ -0,0 +1,22 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:10-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata + +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/postgres/11/Dockerfile b/postgres/11/Dockerfile new file mode 100644 index 0000000..e563ce2 --- /dev/null +++ b/postgres/11/Dockerfile @@ -0,0 +1,22 @@ +# ---------------------------------- +# Environment: Postgres DB +# ----------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:11-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata + +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/postgres/12/Dockerfile b/postgres/12/Dockerfile new file mode 100644 index 0000000..696a68e --- /dev/null +++ b/postgres/12/Dockerfile @@ -0,0 +1,22 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:12-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata + +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/postgres/13/Dockerfile b/postgres/13/Dockerfile new file mode 100644 index 0000000..5fa31b9 --- /dev/null +++ b/postgres/13/Dockerfile @@ -0,0 +1,22 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:13-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata + +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/postgres/14/Dockerfile b/postgres/14/Dockerfile new file mode 100644 index 0000000..411d84e --- /dev/null +++ b/postgres/14/Dockerfile @@ -0,0 +1,22 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:14-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata fontconfig git openssl sqlite tar tzdata + +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/postgres/16/Dockerfile b/postgres/16/Dockerfile new file mode 100644 index 0000000..c2ea945 --- /dev/null +++ b/postgres/16/Dockerfile @@ -0,0 +1,21 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:16-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/postgres/9/Dockerfile b/postgres/9/Dockerfile new file mode 100644 index 0000000..a100fe5 --- /dev/null +++ b/postgres/9/Dockerfile @@ -0,0 +1,21 @@ +# ---------------------------------- +# Environment: Postgres DB +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH postgres:9-alpine + +LABEL author="Parker" maintainer="parker@pterodactyl.io" + +# UID 999 is the default pterodactyl user +RUN adduser -D -h /home/container container + +RUN apk add --no-cache tini curl iproute2 ca-certificates fontconfig git openssl sqlite tar tzdata +USER container +ENV HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/sbin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/postgres/entrypoint.sh b/postgres/entrypoint.sh new file mode 100644 index 0000000..53b47f4 --- /dev/null +++ b/postgres/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/ash +cd /home/container + +#output current postgres version +postgres --version + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/python/2.7/Dockerfile b/python/2.7/Dockerfile new file mode 100644 index 0000000..eee04a5 --- /dev/null +++ b/python/2.7/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH python:2.7-slim + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/python/3.10/Dockerfile b/python/3.10/Dockerfile index 4f7ba4e..d7bb607 100644 --- a/python/3.10/Dockerfile +++ b/python/3.10/Dockerfile @@ -1,38 +1,18 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH python:3.10-slim-bookworm -FROM --platform=$TARGETOS/$TARGETARCH python:3.10-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache cmake make ca-certificates curl ffmpeg g++ gcc git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.11/Dockerfile b/python/3.11/Dockerfile index 6dd08d1..902254c 100644 --- a/python/3.11/Dockerfile +++ b/python/3.11/Dockerfile @@ -1,38 +1,18 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH python:3.11-slim-bookworm -FROM --platform=$TARGETOS/$TARGETARCH python:3.11-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache cmake make ca-certificates curl ffmpeg g++ gcc git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.12/Dockerfile b/python/3.12/Dockerfile new file mode 100644 index 0000000..c695449 --- /dev/null +++ b/python/3.12/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH python:3.12-slim-bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.13/Dockerfile b/python/3.13/Dockerfile new file mode 100644 index 0000000..c985508 --- /dev/null +++ b/python/3.13/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH python:3.13-slim-bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.7/Dockerfile b/python/3.7/Dockerfile index 02be4ee..3d426b9 100644 --- a/python/3.7/Dockerfile +++ b/python/3.7/Dockerfile @@ -1,38 +1,18 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH python:3.7-slim-bookworm -FROM --platform=$TARGETOS/$TARGETARCH python:3.7-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache cmake make ca-certificates curl ffmpeg g++ gcc git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.8/Dockerfile b/python/3.8/Dockerfile index c254b46..b201ec7 100644 --- a/python/3.8/Dockerfile +++ b/python/3.8/Dockerfile @@ -1,38 +1,18 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH python:3.8-slim-bookworm -FROM --platform=$TARGETOS/$TARGETARCH python:3.8-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache cmake make ca-certificates curl ffmpeg g++ gcc git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/python/3.9/Dockerfile b/python/3.9/Dockerfile index 99d38c1..311a447 100644 --- a/python/3.9/Dockerfile +++ b/python/3.9/Dockerfile @@ -1,38 +1,18 @@ -# -# 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. -# +FROM --platform=$TARGETOS/$TARGETARCH python:3.9-slim-bookworm -FROM --platform=$TARGETOS/$TARGETARCH python:3.9-alpine +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" - -LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" -LABEL org.opencontainers.image.licenses=MIT - -RUN apk add --update --no-cache cmake make ca-certificates curl ffmpeg g++ gcc git openssl sqlite tar tzdata \ - && adduser -D -h /home/container container +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container USER container ENV USER=container HOME=/home/container WORKDIR /home/container -COPY ./../entrypoint.sh /entrypoint.sh -CMD [ "/bin/ash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/python/entrypoint.sh b/python/entrypoint.sh index ea252e5..aab4aea 100644 --- a/python/entrypoint.sh +++ b/python/entrypoint.sh @@ -1,49 +1,16 @@ -#!/bin/ash +#!/bin/bash +cd /home/container -# -# 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 +# Make internal Docker IP address available to processes. 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 Python version -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n" +# Print current Python version python --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 -)") +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" -# 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 -exec env ${PARSED} +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/redis/5/Dockerfile b/redis/5/Dockerfile new file mode 100644 index 0000000..b1cc398 --- /dev/null +++ b/redis/5/Dockerfile @@ -0,0 +1,20 @@ +# ---------------------------------- +# Environment: redis +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH redis:5-bullseye + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt -y update && \ + apt -y upgrade && \ + apt -y install iproute2 && \ + useradd -d /home/container -m container -s /bin/bash + +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/redis/6/Dockerfile b/redis/6/Dockerfile new file mode 100644 index 0000000..91f31a7 --- /dev/null +++ b/redis/6/Dockerfile @@ -0,0 +1,20 @@ +# ---------------------------------- +# Environment: redis +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH redis:6-bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt -y update && \ + apt -y upgrade && \ + apt -y install iproute2 && \ + useradd -d /home/container -m container -s /bin/bash + +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/redis/7/Dockerfile b/redis/7/Dockerfile new file mode 100644 index 0000000..d245457 --- /dev/null +++ b/redis/7/Dockerfile @@ -0,0 +1,20 @@ +# ---------------------------------- +# Environment: redis +# ---------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH redis:7-bookworm + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt -y update && \ + apt -y upgrade && \ + apt -y install iproute2 && \ + useradd -d /home/container -m container -s /bin/bash + +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/redis/entrypoint.sh b/redis/entrypoint.sh new file mode 100644 index 0000000..6e19f17 --- /dev/null +++ b/redis/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/rust/1.56/Dockerfile b/rust/1.56/Dockerfile new file mode 100644 index 0000000..7e655cf --- /dev/null +++ b/rust/1.56/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.56-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg tini pkg-config \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/rust/1.60/Dockerfile b/rust/1.60/Dockerfile new file mode 100644 index 0000000..e637221 --- /dev/null +++ b/rust/1.60/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.60-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg tini pkg-config \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/rust/entrypoint.sh b/rust/entrypoint.sh new file mode 100644 index 0000000..c865f6c --- /dev/null +++ b/rust/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Print current Rust version +cargo --version + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/rust/latest/Dockerfile b/rust/latest/Dockerfile new file mode 100644 index 0000000..cae3044 --- /dev/null +++ b/rust/latest/Dockerfile @@ -0,0 +1,16 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg tini pkg-config \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/steamcmd/debian/Dockerfile b/steamcmd/debian/Dockerfile new file mode 100644 index 0000000..7857505 --- /dev/null +++ b/steamcmd/debian/Dockerfile @@ -0,0 +1,78 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +RUN dpkg --add-architecture i386 \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y \ + curl \ + g++ \ + gcc \ + gdb \ + iproute2 \ + locales \ + net-tools \ + netcat-traditional \ + numactl \ + tar \ + telnet \ + tini \ + tzdata \ + wget \ + xvfb \ + lib32gcc-s1 \ + lib32stdc++6 \ + lib32tinfo6 \ + lib32z1 \ + libcurl3-gnutls:i386 \ + libcurl4-gnutls-dev:i386 \ + libcurl4:i386 \ + libfontconfig1 \ + libgcc-11-dev \ + libgcc-12-dev \ + libncurses5:i386 \ + libsdl1.2debian \ + libsdl2-2.0-0 \ + libsdl2-2.0-0:i386 \ + libssl-dev:i386 \ + libtinfo6:i386 + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + + + ## Temp fix for things that still need libssl1.1 +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \ + rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \ + fi + +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/steamcmd/dotnet/Dockerfile b/steamcmd/dotnet/Dockerfile new file mode 100644 index 0000000..56c4743 --- /dev/null +++ b/steamcmd/dotnet/Dockerfile @@ -0,0 +1,38 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +ENV DEBIAN_FRONTEND=noninteractive + +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt install -y tar curl gcc g++ lib32gcc-s1 libgcc1 libcurl4-gnutls-dev:i386 libssl-dev:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat-traditional tzdata \ + && apt install -y libstdc++6 libstdc++6:i386 libc6-amd64 libc6:i386 psmisc libgdiplus libcurl4 libfontconfig1 libpangocairo-1.0-0 libnss3 libgconf-2-4 libxi6 libxcursor1 libxss1 libxcomposite1 libasound2 libxdamage1 libxtst6 libatk1.0-0 libxrandr2 libcurl4 xvfb mesa-utils git \ + && apt install -y python3 python3-dev python3-pip apt-transport-https wget iproute2 sqlite3 xvfb tini \ + && useradd -d /home/container -m container + +RUN apt update -y \ + && apt upgrade -y \ + && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && rm packages-microsoft-prod.deb \ + && apt update -y \ + && apt install -y aspnetcore-runtime-7.0 dotnet-sdk-7.0 libgdiplus aspnetcore-runtime-8.0 dotnet-sdk-8.0 aspnetcore-runtime-9.0 dotnet-sdk-9.0 + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/steamcmd/entrypoint.sh b/steamcmd/entrypoint.sh new file mode 100644 index 0000000..cc42b75 --- /dev/null +++ b/steamcmd/entrypoint.sh @@ -0,0 +1,89 @@ +#!/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. +# + +# Wait for the container to fully initialize +sleep 1 + +# 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 + +# Set environment for Steam Proton +if [ -f "/usr/local/bin/proton" ]; then + if [ ! -z ${SRCDS_APPID} ]; then + mkdir -p /home/container/.steam/steam/steamapps/compatdata/${SRCDS_APPID} + export STEAM_COMPAT_CLIENT_INSTALL_PATH="/home/container/.steam/steam" + export STEAM_COMPAT_DATA_PATH="/home/container/.steam/steam/steamapps/compatdata/${SRCDS_APPID}" + # Fix for pipx with protontricks + export PATH=$PATH:/root/.local/bin + else + echo -e "----------------------------------------------------------------------------------" + echo -e "WARNING!!! Proton needs variable SRCDS_APPID, else it will not work. Please add it" + echo -e "Server stops now" + echo -e "----------------------------------------------------------------------------------" + exit 0 + fi +fi + +# Switch to the container's working directory +cd /home/container || exit 1 + +## just in case someone removed the defaults. +if [ "${STEAM_USER}" == "" ]; then + echo -e "steam user is not set.\n" + echo -e "Using anonymous user.\n" + STEAM_USER=anonymous + STEAM_PASS="" + STEAM_AUTH="" +else + echo -e "user set to ${STEAM_USER}" +fi + +## if auto_update is not set or to 1 update +if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then + # Update Source Server + if [ ! -z ${SRCDS_APPID} ]; then + if [ "${STEAM_USER}" == "anonymous" ]; then + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit + else + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit + fi + else + echo -e "No appid set. Starting Server" + fi + +else + echo -e "Not updating game server as auto update was set to 0. Starting Server" +fi + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/steamcmd/proton/Dockerfile b/steamcmd/proton/Dockerfile new file mode 100644 index 0000000..309391e --- /dev/null +++ b/steamcmd/proton/Dockerfile @@ -0,0 +1,48 @@ +# --------------------------------------------- +# Steam Proton image +# --------------------------------------------- +FROM debian:bookworm-slim + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +## install required packages +RUN dpkg --add-architecture i386 +RUN apt update +RUN apt install -y --no-install-recommends wget iproute2 gnupg2 software-properties-common libntlm0 winbind xvfb xauth libncurses5-dev:i386 libncurses6 dbus libgdiplus lib32gcc-s1 +RUN apt install -y alsa-tools libpulse0 pulseaudio libpulse-dev libasound2 libao-common gnutls-bin gnupg locales numactl cabextract curl python3 python3-pip python3-setuptools tini file pipx +RUN useradd -d /home/container -m container + +# Download Proton GE +RUN curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | egrep .tar.gz)" +RUN tar -xzf GE-Proton*.tar.gz -C /usr/local/bin/ --strip-components=1 +RUN rm GE-Proton*.* + +# Proton Fix machine-id +RUN rm -f /etc/machine-id +RUN dbus-uuidgen --ensure=/etc/machine-id +RUN rm /var/lib/dbus/machine-id +RUN dbus-uuidgen --ensure + +#Setup Protontricks +RUN pipx install protontricks + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/steamcmd/proton_8/Dockerfile b/steamcmd/proton_8/Dockerfile new file mode 100644 index 0000000..a7a74bd --- /dev/null +++ b/steamcmd/proton_8/Dockerfile @@ -0,0 +1,48 @@ +# --------------------------------------------- +# Steam Proton image +# --------------------------------------------- +FROM debian:bookworm-slim + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +## install required packages +RUN dpkg --add-architecture i386 +RUN apt update +RUN apt install -y --no-install-recommends wget iproute2 gnupg2 software-properties-common libntlm0 winbind xvfb xauth libncurses5-dev:i386 libncurses6 dbus libgdiplus lib32gcc-s1 +RUN apt install -y alsa-tools libpulse0 pulseaudio libpulse-dev libasound2 libao-common gnutls-bin gnupg locales numactl cabextract curl python3 python3-pip python3-setuptools tini file pipx +RUN useradd -d /home/container -m container + +# Download Proton GE +RUN curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/tags/GE-Proton8-32 | grep browser_download_url | cut -d\" -f4 | egrep .tar.gz)" +RUN tar -xzf GE-Proton*.tar.gz -C /usr/local/bin/ --strip-components=1 +RUN rm GE-Proton*.* + +# Proton Fix machine-id +RUN rm -f /etc/machine-id +RUN dbus-uuidgen --ensure=/etc/machine-id +RUN rm /var/lib/dbus/machine-id +RUN dbus-uuidgen --ensure + +#Setup Protontricks +RUN pipx install protontricks + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/steamcmd/sniper/Dockerfile b/steamcmd/sniper/Dockerfile new file mode 100644 index 0000000..bc4c8eb --- /dev/null +++ b/steamcmd/sniper/Dockerfile @@ -0,0 +1,31 @@ +# --------------------------------------------- +# Steam Sniper image (RT3) +# --------------------------------------------- +FROM --platform=$TARGETOS/$TARGETARCH registry.gitlab.steamos.cloud/steamrt/sniper/platform:latest-container-runtime-depot + +LABEL author="Alexander Ballauf" maintainer="admin@ballaual.de" +LABEL org.opencontainers.image.description SteamRT3 Platform image for Pterodactyl Source engine servers. + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y tar curl gcc g++ lib32gcc-s1 libgcc1 libcurl4-gnutls-dev:i386 libssl1.1:i386 libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 libsdl2-2.0-0 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat tzdata numactl xvfb tini libc6 \ + && useradd -m -d /home/container container + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/steamcmd/ubuntu/Dockerfile b/steamcmd/ubuntu/Dockerfile new file mode 100644 index 0000000..997e4f6 --- /dev/null +++ b/steamcmd/ubuntu/Dockerfile @@ -0,0 +1,37 @@ +FROM --platform=$TARGETOS/$TARGETARCH ubuntu:22.04 + +LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +RUN dpkg --add-architecture i386 \ + && apt update \ + && apt upgrade -y \ + && apt -y install tar curl gcc g++ lib32gcc-s1 libgcc1 libcurl4-gnutls-dev:i386 libssl-dev:i386 libssl-dev libcurl4:i386 lib32tinfo6 libtinfo6:i386 lib32z1 lib32stdc++6 libncurses5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat tzdata libtinfo6:i386 libtbb2:i386 libtinfo5:i386 libcurl4-gnutls-dev:i386 libcurl4:i386 libncurses5:i386 libcurl3-gnutls:i386 faketime:i386 libtbb2:i386 \ + && apt -y install lib32tinfo6 lib32stdc++6 lib32z1 libtbb2 libtinfo5 libstdc++6 readline-common libncursesw5 libfontconfig1 libnss-wrapper gettext-base libc++-dev libc6-i386 libcurl4 libc6 libc6:i386 libssl3 libssl3:i386 libc6 libc6:i386 xvfb gdb libc++-dev tini + +RUN useradd -d /home/container -m container + +## Specific to pavlov_vr +RUN rm /usr/lib/x86_64-linux-gnu/libc++.so \ + && ln -s /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libc++.so + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/voice/mumble/Dockerfile b/voice/mumble/Dockerfile new file mode 100644 index 0000000..84ca88b --- /dev/null +++ b/voice/mumble/Dockerfile @@ -0,0 +1,40 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim AS builder + +# Copy and run the build script +COPY build.sh /build.sh +RUN chmod +x /build.sh +RUN cd / && ./build.sh + +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +# Create necessary directories +RUN mkdir -p /usr/local/bin /usr/local/share/mumble + +# Copy the built Mumble server binary and the latest tag file and the build log from the builder stage +COPY --from=builder /usr/src/mumble/git/build/mumble-server /usr/local/bin/mumble-server +COPY --from=builder /usr/src/mumble/git/build/latest_tag.txt /usr/local/share/mumble/latest_tag.txt +COPY --from=builder /usr/src/mumble/build.log /usr/local/share/mumble/build.log + +# Install runtime dependencies +RUN apt update \ + && apt -y install curl tar tzdata file ca-certificates sqlite3 iproute2 tini \ + && useradd -m -d /home/container container + +# Needed packages to run the mumble server +RUN apt -y install libqt5sql5 libqt5sql5-sqlite libavahi-compat-libdnssd-dev libqt5dbus5 libzeroc-ice-dev libprotobuf-dev qtbase5-dev qtbase5-dev-tools + +# Set up user and working directory +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +# Set the stop signal +STOPSIGNAL SIGINT + +# Copy and set up the entrypoint script +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Define entrypoint and command +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/voice/mumble/build.sh b/voice/mumble/build.sh new file mode 100644 index 0000000..f289008 --- /dev/null +++ b/voice/mumble/build.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# Mumble compile script. +# Runs on Debian 12 + +LOGFILE="/usr/src/mumble/build.log" + +log() { + echo "$(date +'%Y-%m-%d %H:%M:%S') - $1" | tee -a $LOGFILE +} + +install_dep(){ + log "Installing dependencies..." + apt update && apt -y install \ + build-essential \ + cmake \ + pkg-config \ + qtbase5-dev \ + qtchooser \ + qt5-qmake \ + qtbase5-dev-tools \ + qttools5-dev \ + qttools5-dev-tools \ + libqt5svg5-dev \ + libboost-dev \ + libssl-dev \ + libprotobuf-dev \ + protobuf-compiler \ + libprotoc-dev \ + libcap-dev \ + libxi-dev \ + libasound2-dev \ + libogg-dev \ + libsndfile1-dev \ + libspeechd-dev \ + libavahi-compat-libdnssd-dev \ + libxcb-xinerama0 \ + libzeroc-ice-dev \ + libpoco-dev \ + jq \ + python3 \ + curl \ + git + + if [[ $? -ne 0 ]]; then + log "Failed to install dependencies" + exit 1 + fi + log "Dependencies installed successfully" +} + +# Function to install g++-multilib on amd64 +install_amd64_multilib() { + apt -y install g++-multilib + + if [[ $? -ne 0 ]]; then + log "Failed to install amd multilib dependency" + exit 1 + fi + + log "Multilib AMD64 installed successfully" +} + +# Function to install multilib support on arm64 +install_arm64_multilib() { + apt -y install g++-multilib-x86-64-linux-gnu g++-aarch64-linux-gnu libc6-dev-armhf-cross + + if [[ $? -ne 0 ]]; then + log "Failed to install amd multilib dependency" + exit 1 + fi + + log "Multilib ARM64 installed successfully" +} + +clone_mumble(){ + log "Cloning the Mumble repository..." + + # Create the necessary directories + mkdir -p /usr/src/mumble/git && cd /usr/src/mumble/git + + # Fetch the latest release tag from the GitHub API + LATEST_TAG=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | jq -r .tag_name) + if [[ $? -ne 0 || -z "$LATEST_TAG" ]]; then + log "Failed to fetch the latest release tag" + exit 1 + fi + echo "The latest tag is: $LATEST_TAG" | tee -a $LOGFILE + + # Clone the repository + echo "Running: git clone --branch \"$LATEST_TAG\" https://github.com/mumble-voip/mumble.git ." + git clone --branch "$LATEST_TAG" https://github.com/mumble-voip/mumble.git . + if [[ $? -ne 0 ]]; then + log "Failed to clone the repository" + exit 1 + fi + + # Clone the submodules + git submodule update --init --recursive + if [[ $? -ne 0 ]]; then + log "Failed to update submodules" + exit 1 + fi + + # Create and navigate to the build directory + mkdir -p build && cd build + + echo "$LATEST_TAG" > latest_tag.txt + + # Run cmake with the specified options + cmake -Dbundled-opus=OFF -Dclient=OFF -Dstatic=ON -DCMAKE_BUILD_TYPE=Release .. + if [[ $? -ne 0 ]]; then + log "CMake configuration failed" + exit 1 + fi + + log "Repository cloned and configured successfully" +} + +build_mumble(){ + log "Building Mumble server..." + + cd /usr/src/mumble/git/build + + echo "Using $(nproc) threads to build Mumble server" | tee -a $LOGFILE + cmake --build . -j $(nproc) + if [[ $? -ne 0 ]]; then + log "Build failed" + exit 1 + fi + + ls -la | tee -a $LOGFILE + log "Build completed successfully" +} + +# Install normal deps +install_dep + +# Detect the architecture +ARCH=$(dpkg --print-architecture) + +# Install ARCH specific deps +if [ "$ARCH" = "amd64" ]; then + echo "Detected architecture: amd64" + install_amd64_multilib +elif [ "$ARCH" = "arm64" ]; then + echo "Detected architecture: arm64" + install_arm64_multilib +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +clone_mumble +build_mumble diff --git a/voice/mumble/entrypoint.sh b/voice/mumble/entrypoint.sh new file mode 100644 index 0000000..e7c94f8 --- /dev/null +++ b/voice/mumble/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Print the Muble server version +echo -e "Mumble release version:" +cat /usr/local/share/mumble/latest_tag.txt + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} \ No newline at end of file diff --git a/voice/teaspeak/Dockerfile b/voice/teaspeak/Dockerfile new file mode 100644 index 0000000..068c1ca --- /dev/null +++ b/voice/teaspeak/Dockerfile @@ -0,0 +1,56 @@ +# +# Copyright (c) 2021 Torsten Widmann +# +# 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. +# + +FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim + +LABEL author="Torsten Widmann" maintainer="info@goover.de" + +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT + +ENV DEBIAN_FRONTEND=noninteractive + +## update base packages +RUN apt update \ + && apt upgrade -y + +## install dependencies +RUN apt install -y ffmpeg curl python3 iproute2 libjemalloc2 tini + +# Install latest youtube-dl +RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/youtube-dl +RUN chmod a+rx /usr/local/bin/youtube-dl + +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1000 + +RUN useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/voice/teaspeak/entrypoint.sh b/voice/teaspeak/entrypoint.sh new file mode 100644 index 0000000..6142333 --- /dev/null +++ b/voice/teaspeak/entrypoint.sh @@ -0,0 +1,24 @@ +# 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 + +echo "installed youtube-dl Version:" +/usr/local/bin/youtube-dl --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') + +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" +# shellcheck disable=SC2086 +eval "$PARSED" diff --git a/wine/10/Dockerfile b/wine/10/Dockerfile new file mode 100644 index 0000000..b9b9caf --- /dev/null +++ b/wine/10/Dockerfile @@ -0,0 +1,46 @@ +# --------------------------------------- +# Generic Wine image based on Wine staging +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends wine-stable-i386=10.0.0.0~bookworm-1 -y && \ + apt install --install-recommends wine-stable-amd64=10.0.0.0~bookworm-1 -y && \ + apt install --install-recommends wine-stable=10.0.0.0~bookworm-1 -y && \ + apt install --install-recommends winehq-stable=10.0.0.0~bookworm-1 -y && \ + apt install --install-recommends cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/wine/7/Dockerfile b/wine/7/Dockerfile new file mode 100644 index 0000000..f4809cc --- /dev/null +++ b/wine/7/Dockerfile @@ -0,0 +1,46 @@ +# --------------------------------------- +# Generic Wine image based on Wine stable +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends wine-stable-i386=7.0.2~bookworm-1 -y && \ + apt install --install-recommends wine-stable-amd64=7.0.2~bookworm-1 -y && \ + apt install --install-recommends wine-stable=7.0.2~bookworm-1 -y && \ + apt install --install-recommends winehq-stable=7.0.2~bookworm-1 -y && \ + apt install --install-recommends cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/wine/8/Dockerfile b/wine/8/Dockerfile new file mode 100644 index 0000000..4ad56c4 --- /dev/null +++ b/wine/8/Dockerfile @@ -0,0 +1,46 @@ +# --------------------------------------- +# Generic Wine image based on Wine staging +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends wine-stable-i386=8.0.2~bookworm-1 -y && \ + apt install --install-recommends wine-stable-amd64=8.0.2~bookworm-1 -y && \ + apt install --install-recommends wine-stable=8.0.2~bookworm-1 -y && \ + apt install --install-recommends winehq-stable=8.0.2~bookworm-1 -y && \ + apt install --install-recommends cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/wine/9/Dockerfile b/wine/9/Dockerfile new file mode 100644 index 0000000..23f2b92 --- /dev/null +++ b/wine/9/Dockerfile @@ -0,0 +1,46 @@ +# --------------------------------------- +# Generic Wine image based on Wine staging +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends wine-stable-i386=9.0.0.0~bookworm-1 -y && \ + apt install --install-recommends wine-stable-amd64=9.0.0.0~bookworm-1 -y && \ + apt install --install-recommends wine-stable=9.0.0.0~bookworm-1 -y && \ + apt install --install-recommends winehq-stable=9.0.0.0~bookworm-1 -y && \ + apt install --install-recommends cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] \ No newline at end of file diff --git a/wine/devel/Dockerfile b/wine/devel/Dockerfile new file mode 100644 index 0000000..b296d18 --- /dev/null +++ b/wine/devel/Dockerfile @@ -0,0 +1,42 @@ +# --------------------------------------- +# Generic Wine image based on Wine devel +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends winehq-devel cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/wine/entrypoint.sh b/wine/entrypoint.sh new file mode 100644 index 0000000..d79d6db --- /dev/null +++ b/wine/entrypoint.sh @@ -0,0 +1,90 @@ +#!/bin/bash +cd /home/container + +# Information output +echo "Running on Debian $(cat /etc/debian_version)" +echo "Current timezone: $(cat /etc/timezone)" +wine --version + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +## just in case someone removed the defaults. +if [ "${STEAM_USER}" == "" ]; then + echo -e "steam user is not set.\n" + echo -e "Using anonymous user.\n" + STEAM_USER=anonymous + STEAM_PASS="" + STEAM_AUTH="" +else + echo -e "user set to ${STEAM_USER}" +fi + +## if auto_update is not set or to 1 update +if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then + # Update Source Server + if [ ! -z ${SRCDS_APPID} ]; then + if [ "${STEAM_USER}" == "anonymous" ]; then + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + else + numactl --physcpubind=+0 ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update 1007 +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + fi + else + echo -e "No appid set. Starting Server" + fi + +else + echo -e "Not updating game server as auto update was set to 0. Starting Server" +fi + +if [[ $XVFB == 1 ]]; then + Xvfb :0 -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x${DISPLAY_DEPTH} & +fi + +# Install necessary to run packages +echo "First launch will throw some errors. Ignore them" + +mkdir -p $WINEPREFIX + +# Check if wine-gecko required and install it if so +if [[ $WINETRICKS_RUN =~ gecko ]]; then + echo "Installing Gecko" + WINETRICKS_RUN=${WINETRICKS_RUN/gecko} + + if [ ! -f "$WINEPREFIX/gecko_x86.msi" ]; then + wget -q -O $WINEPREFIX/gecko_x86.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86.msi + fi + + if [ ! -f "$WINEPREFIX/gecko_x86_64.msi" ]; then + wget -q -O $WINEPREFIX/gecko_x86_64.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86_64.msi + fi + + wine msiexec /i $WINEPREFIX/gecko_x86.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_install.log + wine msiexec /i $WINEPREFIX/gecko_x86_64.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_64_install.log +fi + +# Check if wine-mono required and install it if so +if [[ $WINETRICKS_RUN =~ mono ]]; then + echo "Installing mono" + WINETRICKS_RUN=${WINETRICKS_RUN/mono} + + if [ ! -f "$WINEPREFIX/mono.msi" ]; then + wget -q -O $WINEPREFIX/mono.msi https://dl.winehq.org/wine/wine-mono/9.1.0/wine-mono-9.1.0-x86.msi + fi + + wine msiexec /i $WINEPREFIX/mono.msi /qn /quiet /norestart /log $WINEPREFIX/mono_install.log +fi + +# List and install other packages +for trick in $WINETRICKS_RUN; do + echo "Installing $trick" + winetricks -q $trick +done + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/wine/latest/Dockerfile b/wine/latest/Dockerfile new file mode 100644 index 0000000..e37efe8 --- /dev/null +++ b/wine/latest/Dockerfile @@ -0,0 +1,42 @@ +# --------------------------------------- +# Generic Wine image based on Wine stable +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends winehq-stable cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] diff --git a/wine/staging/Dockerfile b/wine/staging/Dockerfile new file mode 100644 index 0000000..2599cf1 --- /dev/null +++ b/wine/staging/Dockerfile @@ -0,0 +1,42 @@ +# --------------------------------------- +# Generic Wine image based on Wine staging +# --------------------------------------- +FROM ghcr.io/parkervcp/yolks:debian + +LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" +LABEL org.opencontainers.image.licenses=MIT + +## install required packages +RUN dpkg --add-architecture i386 \ + && apt update -y \ + && apt install -y --no-install-recommends gnupg2 numactl tzdata software-properties-common libntlm0 winbind xvfb xauth python3 libncurses5:i386 libncurses6:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 + +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends winehq-staging cabextract wine-binfmt -y + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ + && chmod +x /usr/sbin/winetricks + +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDEBUG=-all +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 +ENV AUTO_UPDATE=1 +ENV XVFB=1 + +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ]