diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 6d95474..258a506 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -18,6 +18,7 @@ jobs: - arma3 - fivem - source + - mohaa steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/README.md b/README.md index 591624b..ee4c5ed 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,11 @@ is tagged correctly. * [`arma3`](/games/arma3) * `ghcr.io/parkervcp/games:arma3` * [`fivem`](/games/fivem) - * `ghcr.io/parkervcp/games:fivem` + * `ghcr.io/parkervcp/games:fivem` * [`source`](/games/source) - * `ghcr.io/parkervcp/games:source` + * `ghcr.io/parkervcp/games:source` + * [`mohaa`](games/mohaa) + * `ghcr.io/pterodactyl/games:mohaa` ### [Golang](/go) * [`go1.14`](/go/1.14) * `ghcr.io/parkervcp/yolks:go_1.14` diff --git a/games/mohaa/Dockerfile b/games/mohaa/Dockerfile new file mode 100644 index 0000000..51753da --- /dev/null +++ b/games/mohaa/Dockerfile @@ -0,0 +1,22 @@ +FROM --platform=$TARGETOS/$TARGETARCH debian:bullseye-slim + +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 locales \ + && 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/games/mohaa/entrypoint.sh b/games/mohaa/entrypoint.sh new file mode 100644 index 0000000..7fecb8b --- /dev/null +++ b/games/mohaa/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}