Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit cbe953c

Browse files
authored
mono: make steamcmd work and build for arm64
1 parent 33e2794 commit cbe953c

File tree

3 files changed

+56
-9
lines changed

3 files changed

+56
-9
lines changed

Diff for: .github/workflows/mono.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
context: ./mono
3333
file: ./mono/${{ matrix.tag }}/Dockerfile
34-
platforms: linux/amd64
34+
platforms: linux/amd64,linux/arm64
3535
push: true
3636
tags: |
3737
ghcr.io/parkervcp/yolks:mono_${{ matrix.tag }}

Diff for: mono/entrypoint.sh

+44-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,52 @@
11
#!/bin/bash
2-
cd /home/container
2+
# Wait for the container to fully initialize
3+
sleep 1
34

4-
# Make internal Docker IP address available to processes.
5+
# Default the TZ environment variable to UTC.
6+
TZ=${TZ:-UTC}
7+
export TZ
8+
9+
# Set environment variable that holds the Internal Docker IP
510
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
611
export INTERNAL_IP
712

13+
# Switch to the container's working directory
14+
cd /home/container || exit 1
15+
16+
if [ ! -z "${SRCDS_APPID}" ]; then
17+
## just in case someone removed the defaults.
18+
if [ "${STEAM_USER}" == "" ]; then
19+
echo -e "steam user is not set.\n"
20+
echo -e "Using anonymous user.\n"
21+
STEAM_USER=anonymous
22+
STEAM_PASS=""
23+
STEAM_AUTH=""
24+
else
25+
echo -e "user set to ${STEAM_USER}"
26+
fi
27+
28+
## if auto_update is not set or to 1 update
29+
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
30+
# Update Source Server
31+
if [ ! -z ${SRCDS_APPID} ]; then
32+
if [ "${STEAM_USER}" == "anonymous" ]; then
33+
./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
34+
else
35+
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
36+
fi
37+
else
38+
echo -e "No appid set. Starting Server"
39+
fi
40+
41+
else
42+
echo -e "Not updating game server as auto update was set to 0. Starting Server"
43+
fi
44+
fi
45+
46+
847
# Replace Startup Variables
9-
MODIFIED_STARTUP="eval $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')"
10-
echo ":/home/container$ ${MODIFIED_STARTUP}"
48+
MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
49+
echo -e ":/home/container$ ${MODIFIED_STARTUP}"
1150

1251
# Run the Server
13-
${MODIFIED_STARTUP}
52+
eval ${MODIFIED_STARTUP}

Diff for: mono/latest/Dockerfile

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
FROM ghcr.io/parkervcp/yolks:debian
1+
FROM --platform=$TARGETOS/$TARGETARCH ghcr.io/parkervcp/yolks:debian
22

33
LABEL author="Torsten Widmann" maintainer="[email protected]"
44

55
RUN apt update \
66
&& apt -y upgrade
7-
RUN apt install -y fontconfig dirmngr
7+
RUN apt install -y fontconfig dirmngr numactl
88
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
99
RUN sh -c 'echo "deb https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list'
1010
RUN apt update
11-
RUN apt install -y mono-complete lib32gcc-s1
11+
RUN apt install -y mono-complete
12+
13+
# Only install the needed steamcmd packages on the AMD64 build
14+
RUN if [ "$(uname -m)" = "x86_64" ]; then \
15+
dpkg --add-architecture i386 && \
16+
apt update && \
17+
apt -y install lib32gcc-s1 libsdl2-2.0-0:i386; \
18+
fi
19+
1220

1321
USER container
1422
ENV USER=container HOME=/home/container

0 commit comments

Comments
 (0)