diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 2c3caf9..63fee3e 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -24,7 +24,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index ba9b0fe..b06010c 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - name: Set up QEMU uses: docker/setup-qemu-action@master diff --git a/.github/workflows/box64.yml b/.github/workflows/box64.yml index 5cf53fb..053d459 100644 --- a/.github/workflows/box64.yml +++ b/.github/workflows/box64.yml @@ -22,7 +22,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/cassandra.yml b/.github/workflows/cassandra.yml index 27659d4..7bfc00c 100644 --- a/.github/workflows/cassandra.yml +++ b/.github/workflows/cassandra.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 2b2d8e0..731314b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -23,7 +23,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 549d48f..9d61824 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index 3b9986c..b28c579 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 09cb0ce..7389bc5 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bc31cfa..cab5f5b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml index 82a47db..33f3468 100644 --- a/.github/workflows/installers.yml +++ b/.github/workflows/installers.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 8ede371..748ec67 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -29,7 +29,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/mariadb.yml b/.github/workflows/mariadb.yml index e6eaac5..0c9aee7 100644 --- a/.github/workflows/mariadb.yml +++ b/.github/workflows/mariadb.yml @@ -27,7 +27,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/mongodb.yml b/.github/workflows/mongodb.yml index 4e9d850..65f533c 100644 --- a/.github/workflows/mongodb.yml +++ b/.github/workflows/mongodb.yml @@ -25,7 +25,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/mono.yml b/.github/workflows/mono.yml index 4abac14..af8241f 100644 --- a/.github/workflows/mono.yml +++ b/.github/workflows/mono.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9c3b6c9..f84b7fa 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,7 +27,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml index 5850ab5..c13f81c 100644 --- a/.github/workflows/postgres.yml +++ b/.github/workflows/postgres.yml @@ -28,7 +28,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 970c6ec..d7f21c2 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -28,7 +28,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/redis.yml b/.github/workflows/redis.yml index 144c1a0..3a5d93c 100644 --- a/.github/workflows/redis.yml +++ b/.github/workflows/redis.yml @@ -25,7 +25,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6f2c721..a339444 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,7 +26,7 @@ jobs: - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/steamcmd.yml b/.github/workflows/steamcmd.yml new file mode 100644 index 0000000..f1282a2 --- /dev/null +++ b/.github/workflows/steamcmd.yml @@ -0,0 +1,41 @@ +name: build steamcmd +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - steamcmd/** +jobs: + push: + name: "steamcmd:${{ matrix.distro }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro: + - debian + - ubuntu + - dotnet + + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + with: + version: "v0.9.1" + buildkitd-flags: --debug + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v3 + with: + context: ./steamcmd/${{ matrix.distro }} + file: ./steamcmd/${{ matrix.distro }}/Dockerfile + platforms: linux/amd64 + push: true + tags: | + ghcr.io/parkervcp/steamcmd:${{ matrix.distro }} diff --git a/.github/workflows/voice.yml b/.github/workflows/voice.yml index 61c6f7e..f4a3ecb 100644 --- a/.github/workflows/voice.yml +++ b/.github/workflows/voice.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/.github/workflows/wine.yml b/.github/workflows/wine.yml index 21bdcc1..de09559 100644 --- a/.github/workflows/wine.yml +++ b/.github/workflows/wine.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 with: - version: "v0.8.2" + version: "v0.9.1" buildkitd-flags: --debug - uses: docker/login-action@v2 with: diff --git a/README.md b/README.md index 870efcd..75f0684 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,14 @@ is tagged correctly. * ['rust latest'](/rust/latest) * `ghcr.io/parkervcp/yolks:rust_latest` +### [SteamCMD](/steamcmd) +* [`SteamCMD Debian lastest`](/steamcmd/debian) + * `ghcr.io/parkervcp/steamcmd:debian` +* [`SteamCMD Debian Dotnet`](/steamcmd/dotnet) + * `ghcr.io/parkervcp/steamcmd:dotnet` +* [`SteamCMD Ubuntu latest LTS`](/steamcmd/ubuntu) + * `ghcr.io/parkervcp/steamcmd:ubuntu` + ### [Voice](/voice) * [`Mumble`](/voice/mumble) * `ghcr.io/parkervcp/yolks:voice_mumble` diff --git a/steamcmd/debian/Dockerfile b/steamcmd/debian/Dockerfile new file mode 100644 index 0000000..a0c3a57 --- /dev/null +++ b/steamcmd/debian/Dockerfile @@ -0,0 +1,27 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bullseye-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 update \ + && apt upgrade -y \ + && apt 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 iproute2 gdb libsdl1.2debian libfontconfig1 telnet net-tools netcat tzdata numactl \ + && useradd -m -d /home/container container + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.2/rcon-0.10.2-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.2-amd64_linux/rcon /usr/local/bin/ + +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/steamcmd/dotnet/Dockerfile b/steamcmd/dotnet/Dockerfile new file mode 100644 index 0000000..ae62a33 --- /dev/null +++ b/steamcmd/dotnet/Dockerfile @@ -0,0 +1,34 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bullseye-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 libssl1.1: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 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 \ + && useradd -d /home/container -m container + +RUN apt update -y \ + && apt upgrade -y \ + && wget https://packages.microsoft.com/config/debian/11/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 + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.2/rcon-0.10.2-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.2-amd64_linux/rcon /usr/local/bin/ + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/steamcmd/entrypoint.sh b/steamcmd/entrypoint.sh new file mode 100644 index 0000000..153b869 --- /dev/null +++ b/steamcmd/entrypoint.sh @@ -0,0 +1,73 @@ +#!/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 + +# 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 ${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 ${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 + +# 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/ubuntu/Dockerfile b/steamcmd/ubuntu/Dockerfile new file mode 100644 index 0000000..f4477a8 --- /dev/null +++ b/steamcmd/ubuntu/Dockerfile @@ -0,0 +1,29 @@ +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 + +RUN useradd -d /home/container -m container + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.2/rcon-0.10.2-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.2-amd64_linux/rcon /usr/local/bin/ + +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