diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 2a84791..d4ec133 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -18,7 +18,9 @@ jobs: game: - altv - arma3 + - samp - source + steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 diff --git a/README.md b/README.md index fa04efe..e0ddbbe 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,12 @@ is tagged correctly. * `ghcr.io/parkervcp/games:altv` * [`arma3`](/games/arma3) * `ghcr.io/parkervcp/games:arma3` +* [`samp`](/games/samp) + * `ghcr.io/parkervcp/games:samp` * [`source`](/games/source) * `ghcr.io/parkervcp/games:source` + ### [Golang](/go) * [`go1.14`](/go/1.14) diff --git a/games/samp/Dockerfile b/games/samp/Dockerfile new file mode 100644 index 0000000..e1b5ff4 --- /dev/null +++ b/games/samp/Dockerfile @@ -0,0 +1,23 @@ +FROM --platform=$BUILDPLATFORM debian:bullseye-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 curl iproute2 openssl fontconfig dirmngr ca-certificates dnsutils tzdata zip \ + && apt install -y libtbb2: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/* + + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/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}