init: yolks for GMod 64-bit and Stalwart Mail Server
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
FROM --platform=$TARGETOS/$TARGETARCH debian:bookworm-slim
|
||||
|
||||
LABEL author="RefoselTeam" maintainer="admin@refoseltw.ru"
|
||||
|
||||
LABEL org.opencontainers.image.source="https://gitea.refoseltw.ru/RefoselTeamWork/yolks"
|
||||
LABEL org.opencontainers.image.licenses=MIT
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN dpkg --add-architecture i386 \
|
||||
&& apt update \
|
||||
&& apt upgrade -y \
|
||||
&& apt install -y \
|
||||
curl \
|
||||
g++ \
|
||||
gcc \
|
||||
gdb \
|
||||
git \
|
||||
iproute2 \
|
||||
locales \
|
||||
net-tools \
|
||||
netcat-traditional \
|
||||
tar \
|
||||
telnet \
|
||||
tini \
|
||||
tzdata \
|
||||
wget \
|
||||
lib32gcc-s1 \
|
||||
lib32stdc++6 \
|
||||
lib32tinfo6 \
|
||||
lib32z1 \
|
||||
libcurl3-gnutls:i386 \
|
||||
libcurl4-gnutls-dev:i386 \
|
||||
libcurl4:i386 \
|
||||
libfontconfig1 \
|
||||
libgcc-11-dev \
|
||||
libgcc-12-dev \
|
||||
libncurses5:i386 \
|
||||
libsdl1.2debian \
|
||||
libsdl2-2.0-0:i386 \
|
||||
libssl-dev:i386 \
|
||||
libtinfo6:i386 \
|
||||
&& apt clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install SteamCMD
|
||||
RUN mkdir -p /usr/games/steamcmd \
|
||||
&& cd /usr/games/steamcmd \
|
||||
&& curl -sSL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xzv
|
||||
|
||||
# Install rcon
|
||||
RUN cd /tmp/ \
|
||||
&& curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \
|
||||
&& tar xvf rcon.tar.gz \
|
||||
&& mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
# Temp fix for things that still need libssl1.1
|
||||
RUN if [ "$(uname -m)" = "x86_64" ]; then \
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
|
||||
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
|
||||
rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \
|
||||
fi
|
||||
|
||||
# Set the locale
|
||||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||
locale-gen
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV LANGUAGE=en_US:en
|
||||
ENV LC_ALL=en_US.UTF-8
|
||||
|
||||
# Setup user and working directory
|
||||
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"]
|
||||
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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
|
||||
|
||||
# Default steam user
|
||||
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
|
||||
|
||||
# Auto update
|
||||
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
|
||||
if [ ! -z ${SRCDS_APPID} ]; then
|
||||
/usr/games/steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update 1007 +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
|
||||
|
||||
# Create Steam SDK symlinks
|
||||
mkdir -p .steam/sdk64
|
||||
ln -sf /usr/games/steamcmd/linux64/steamclient.so .steam/sdk64/steamclient.so
|
||||
ln -sf /usr/games/steamcmd/linux32/steamclient.so .steam/sdk32/steamclient.so
|
||||
|
||||
# Clone Git addons if GIT_REPOS is set
|
||||
if [ ! -z "${GIT_REPOS}" ]; then
|
||||
IFS=',' read -ra REPOS <<< "$GIT_REPOS"
|
||||
for repo in "${REPOS[@]}"; do
|
||||
repo=$(echo "$repo" | xargs)
|
||||
if [ ! -z "$repo" ]; then
|
||||
REPO_NAME=$(basename "$repo" .git)
|
||||
ADDON_DIR="garrysmod/addons/${REPO_NAME}"
|
||||
if [ -d "$ADDON_DIR/.git" ]; then
|
||||
echo "Updating Git addon: ${REPO_NAME}..."
|
||||
cd "$ADDON_DIR" && git pull && cd /home/container
|
||||
else
|
||||
echo "Cloning Git addon: ${REPO_NAME}..."
|
||||
git clone "$repo" "$ADDON_DIR"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Load Workshop collection
|
||||
if [ ! -z "${SRCDS_WORKSHOP_COLLECTION}" ]; then
|
||||
echo "Workshop collection ${SRCDS_WORKSHOP_COLLECTION} will be loaded on first start."
|
||||
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}
|
||||
Reference in New Issue
Block a user