From b0132afa4684575778d732ffe2724b2a8752e1eb Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Mon, 17 May 2021 21:24:17 -0400 Subject: [PATCH 1/7] Update README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index c8b930a..1ea0849 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # 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. @@ -18,6 +19,56 @@ All of these images are available for `linux/amd64` and `linux/arm64` versions, these images on an arm system, no modification to them or the tag is needed, they should just work. ### Contributing + When adding a new version to an existing image, such as `java v42`, you'd add it within a child folder of `java`, so `java/42/Dockerfile` for example. Please also update the correct `.github/workflows` file to ensure that this new version is tagged correctly. + +## Available Images + +* [`fivem`](https://github.com/pterodactyl/yolks/tree/master/games/fivem) + * `ghcr.io/pterodactyl/games:fivem` +* [`golang`](https://github.com/pterodactyl/yolks/tree/master/go) + * [`go1.14`](https://github.com/pterodactyl/yolks/tree/master/go/1.14) + * `ghcr.io/pterodactyl/yolks:go_1.14` + * [`go1.15`](https://github.com/pterodactyl/yolks/tree/master/go/1.15) + * `ghcr.io/pterodactyl/yolks:go_1.15` + * [`go1.16`](https://github.com/pterodactyl/yolks/tree/master/go/1.16) + * `ghcr.io/pterodactyl/yolks:go_1.16` +* [`java`](https://github.com/pterodactyl/yolks/tree/master/java) + * [`java7`](https://github.com/pterodactyl/yolks/tree/master/java/7) + * `ghcr.io/pterodactyl/yolks:java_7` + * [`java8`](https://github.com/pterodactyl/yolks/tree/master/java/8) + * `ghcr.io/pterodactyl/yolks:java_8` + * [`java9`](https://github.com/pterodactyl/yolks/tree/master/java/9) + * `ghcr.io/pterodactyl/yolks:java_9` + * [`java11`](https://github.com/pterodactyl/yolks/tree/master/java/11) + * `ghcr.io/pterodactyl/yolks:java_11` + * [`java14`](https://github.com/pterodactyl/yolks/tree/master/java/14) + * `ghcr.io/pterodactyl/yolks:java_14` + * [`java16`](https://github.com/pterodactyl/yolks/tree/master/java/16) + * `ghcr.io/pterodactyl/yolks:java_16` +* [`nodejs`](https://github.com/pterodactyl/yolks/tree/master/nodejs) + * [`node12`](https://github.com/pterodactyl/yolks/tree/master/nodejs/12) + * `ghcr.io/pterodactyl/yolks:nodejs_12` + * [`node14`](https://github.com/pterodactyl/yolks/tree/master/nodejs/14) + * `ghcr.io/pterodactyl/yolks:nodejs_14` + * [`node15`](https://github.com/pterodactyl/yolks/tree/master/nodejs/15) + * `ghcr.io/pterodactyl/yolks:nodejs_15` + * [`node16`](https://github.com/pterodactyl/yolks/tree/master/nodejs/16) + * `ghcr.io/pterodactyl/yolks:nodejs_16` +* [`python`](https://github.com/pterodactyl/yolks/tree/master/python) + * [`python3.7`](https://github.com/pterodactyl/yolks/tree/master/python/3.7) + * `ghcr.io/pterodactyl/yolks:python_3.7` + * [`python3.8`](https://github.com/pterodactyl/yolks/tree/master/python/3.8) + * `ghcr.io/pterodactyl/yolks:python_3.8` + * [`python3.9`](https://github.com/pterodactyl/yolks/tree/master/python/3.9) + * `ghcr.io/pterodactyl/yolks:python_3.9` + +### Installation Images + +* [`alpine-install`](https://github.com/pterodactyl/yolks/tree/master/installers/alpine) + * `ghcr.io/pterodactyl/installers:alpine` + +* [`source-install`](https://github.com/pterodactyl/yolks/tree/master/installers/source) + * `ghcr.io/pterodactyl/installers:source` From a3219c58dccaf2e07b9a9094640aedf2095f415f Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Sat, 29 May 2021 21:16:28 -0400 Subject: [PATCH 2/7] Change source to debian --- .github/workflows/installers.yml | 2 +- installers/{source => debian}/Dockerfile | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename installers/{source => debian}/Dockerfile (100%) diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index e42e3d8..b89ddd4 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -16,7 +16,7 @@ jobs: matrix: tag: - alpine - - source + - debian steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/installers/source/Dockerfile b/installers/debian/Dockerfile similarity index 100% rename from installers/source/Dockerfile rename to installers/debian/Dockerfile From 78f52a2c965d14ed7fdf403e97e3b2babf20e73e Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Sat, 5 Jun 2021 16:47:35 -0400 Subject: [PATCH 3/7] Create alpine.yml --- .github/workflows/alpine.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/alpine.yml diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml new file mode 100644 index 0000000..2e606c0 --- /dev/null +++ b/.github/workflows/alpine.yml @@ -0,0 +1,34 @@ +name: build alpine +on: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - alpine/** +jobs: + push: + name: "yolks:alpine" + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: ./alpine + file: ./alpine/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/pterodactyl/yolks:alpine From b8ba21765c83f4349dff547a78f509d353769ec7 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 13 Jun 2021 11:00:35 -0700 Subject: [PATCH 4/7] Update entrypoint.sh --- alpine/entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/alpine/entrypoint.sh b/alpine/entrypoint.sh index 602caec..7039fb0 100644 --- a/alpine/entrypoint.sh +++ b/alpine/entrypoint.sh @@ -1,6 +1,5 @@ #!/bin/ash -# # Copyright (c) 2021 Matthew Penner # # Permission is hereby granted, free of charge, to any person obtaining a copy From 9e243293ba8209cb8d0a3f6bfc02c6df802c08d2 Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Thu, 17 Jun 2021 20:20:01 -0400 Subject: [PATCH 5/7] Add auto update script Add's auto-update option inside entry point if `AUTO_UPDATE` flag is set to 1 Pulled from parkers entrypoint for source debian --- games/source/entrypoint.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/games/source/entrypoint.sh b/games/source/entrypoint.sh index d5cfc60..b04e3c6 100644 --- a/games/source/entrypoint.sh +++ b/games/source/entrypoint.sh @@ -38,6 +38,30 @@ cd /home/container || exit 1 # 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 + 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 +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir /home/container +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 + # 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" From 88180b3f5c58426d2cd478a93d96b7ecff16af2a Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Mon, 21 Jun 2021 19:27:00 -0400 Subject: [PATCH 6/7] Add Base Debian (#5) --- .github/workflows/{alpine.yml => base.yml} | 16 +++++--- README.md | 4 ++ {alpine => oses/alpine}/Dockerfile | 0 {alpine => oses/alpine}/entrypoint.sh | 0 oses/debian/Dockerfile | 23 +++++++++++ oses/debian/entrypoint.sh | 45 ++++++++++++++++++++++ 6 files changed, 82 insertions(+), 6 deletions(-) rename .github/workflows/{alpine.yml => base.yml} (68%) rename {alpine => oses/alpine}/Dockerfile (100%) rename {alpine => oses/alpine}/entrypoint.sh (100%) create mode 100644 oses/debian/Dockerfile create mode 100644 oses/debian/entrypoint.sh diff --git a/.github/workflows/alpine.yml b/.github/workflows/base.yml similarity index 68% rename from .github/workflows/alpine.yml rename to .github/workflows/base.yml index 2e606c0..3a37190 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/base.yml @@ -1,4 +1,4 @@ -name: build alpine +name: build oses on: schedule: - cron: "0 0 * * 1" @@ -6,13 +6,17 @@ on: branches: - master paths: - - alpine/** + - oses/** jobs: push: - name: "yolks:alpine" + name: "yolks:${{ matrix.oses }}" runs-on: ubuntu-latest strategy: fail-fast: false + matrix: + oses: + - alpine + - debian steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 @@ -26,9 +30,9 @@ jobs: password: ${{ secrets.REGISTRY_TOKEN }} - uses: docker/build-push-action@v2 with: - context: ./alpine - file: ./alpine/Dockerfile + context: ./oses/${{ matrix.oses }} + file: ./oses/${{ matrix.oses }}/Dockerfile platforms: linux/amd64 push: true tags: | - ghcr.io/pterodactyl/yolks:alpine + ghcr.io/pterodactyl/yolks:${{ matrix.oses }} diff --git a/README.md b/README.md index 1ea0849..852717e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ is tagged correctly. ## Available Images +* [`alpine`](https://github.com/pterodactyl/yolks/tree/master/oses/alpine) + * `ghcr.io/pterodactyl/yolks:alpine` +* [`debian`](https://github.com/pterodactyl/yolks/tree/master/oses/debian) + * `ghcr.io/pterodactyl/yolks:debian` * [`fivem`](https://github.com/pterodactyl/yolks/tree/master/games/fivem) * `ghcr.io/pterodactyl/games:fivem` * [`golang`](https://github.com/pterodactyl/yolks/tree/master/go) diff --git a/alpine/Dockerfile b/oses/alpine/Dockerfile similarity index 100% rename from alpine/Dockerfile rename to oses/alpine/Dockerfile diff --git a/alpine/entrypoint.sh b/oses/alpine/entrypoint.sh similarity index 100% rename from alpine/entrypoint.sh rename to oses/alpine/entrypoint.sh diff --git a/oses/debian/Dockerfile b/oses/debian/Dockerfile new file mode 100644 index 0000000..ecf0b0f --- /dev/null +++ b/oses/debian/Dockerfile @@ -0,0 +1,23 @@ +FROM --platform=linux/amd64 debian:buster-slim + +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 && apt upgrade -y \ + && apt install -y gcc g++ libgcc1 lib32gcc1 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 + +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" ] diff --git a/oses/debian/entrypoint.sh b/oses/debian/entrypoint.sh new file mode 100644 index 0000000..d5cfc60 --- /dev/null +++ b/oses/debian/entrypoint.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# +# Copyright (c) 2021 Matthew Penner +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}') +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 -)") + +# 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} From c32aab26020ea0a24cd97131399b912a2fdba6b0 Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Mon, 21 Jun 2021 20:13:08 -0400 Subject: [PATCH 7/7] Build the new images --- oses/alpine/entrypoint.sh | 1 - oses/debian/entrypoint.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/oses/alpine/entrypoint.sh b/oses/alpine/entrypoint.sh index 7039fb0..98c51d4 100644 --- a/oses/alpine/entrypoint.sh +++ b/oses/alpine/entrypoint.sh @@ -1,5 +1,4 @@ #!/bin/ash - # Copyright (c) 2021 Matthew Penner # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/oses/debian/entrypoint.sh b/oses/debian/entrypoint.sh index d5cfc60..7fecb8b 100644 --- a/oses/debian/entrypoint.sh +++ b/oses/debian/entrypoint.sh @@ -1,5 +1,4 @@ #!/bin/bash - # # Copyright (c) 2021 Matthew Penner #