diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml new file mode 100644 index 0000000..3a37190 --- /dev/null +++ b/.github/workflows/base.yml @@ -0,0 +1,38 @@ +name: build oses +on: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - oses/** +jobs: + push: + 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 + 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: ./oses/${{ matrix.oses }} + file: ./oses/${{ matrix.oses }}/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/pterodactyl/yolks:${{ matrix.oses }} 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/README.md b/README.md index c8b930a..852717e 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,60 @@ 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 + +* [`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) + * [`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` 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" diff --git a/installers/source/Dockerfile b/installers/debian/Dockerfile similarity index 100% rename from installers/source/Dockerfile rename to installers/debian/Dockerfile 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 99% rename from alpine/entrypoint.sh rename to oses/alpine/entrypoint.sh index 602caec..98c51d4 100644 --- a/alpine/entrypoint.sh +++ b/oses/alpine/entrypoint.sh @@ -1,6 +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/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..7fecb8b --- /dev/null +++ b/oses/debian/entrypoint.sh @@ -0,0 +1,44 @@ +#!/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}