Skip to content

Commit

Permalink
add battleofwesnod testimage
Browse files Browse the repository at this point in the history
  • Loading branch information
gOOvER committed Apr 6, 2024
1 parent 84be80f commit 409047b
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/games.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- samp
- screeps
- staxel
- thebattleofwesnod
- thefront
- valheim
- wurm
Expand Down
62 changes: 62 additions & 0 deletions games/thebattleofwesnoth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM --platform=$TARGETOS/$TARGETARCH ubuntu:22.04

LABEL author="Michael Parker" maintainer="[email protected]"

ARG DEBIAN_FRONTEND noninteractive

# update base packages
RUN apt update \
&& apt upgrade -y

# install dependencies
RUN apt install -y \
cmake \
g++ \
gcc \
gdb \
git \
openssl \
tar \
tini \
unzip \
zip \
zlib1g-dev \
libboost-coroutine-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-iostreams-dev \
libboost-locale-dev \
libboost-program-options-dev \
libboost-random-dev \
libboost-regex-dev \
libboost-system-dev \
libbz2-dev \
libc++-dev \
libc6 \
libcairo2-dev \
libcrypto++-dev \
libcurl4-openssl-dev \
libgcc1 \
libsdl-pango-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libssl-dev \
libvorbis-dev \

# configure locale
RUN update-locale lang=en_US.UTF-8 \
&& dpkg-reconfigure --frontend noninteractive locales

## add container user
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

STOPSIGNAL SIGINT

COPY --chown=container:container ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
20 changes: 20 additions & 0 deletions games/thebattleofwesnoth/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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

# 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}

0 comments on commit 409047b

Please sign in to comment.