-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (54 loc) · 2.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
###########################################################
# Dockerfile that builds a KF2 Gameserver
###########################################################
# BUILD STAGE
FROM debian:bookworm-slim AS build_stage
LABEL maintainer="[email protected]"
ENV HOMEDIR /home/steam
ENV USER steam
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
ENV STEAMAPPID 232130
ENV STEAMAPP kf2
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ARG PUID=1000
# Update OS, Get Requirements
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
lib32stdc++6=12.2.0-14 \
lib32gcc-s1=12.2.0-14 \
ca-certificates=20230311 \
nano=7.2-1 \
curl=7.88.1-10+deb12u5 \
locales=2.36-9+deb12u4 \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
# Create unprivileged user
&& useradd -u "${PUID}" -m "${USER}" \
# Download SteamCMD, execute as user
&& su "${USER}" -c \
"mkdir -p \"${STEAMCMDDIR}\" \
&& curl -fsSL 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz' | tar xvzf - -C \"${STEAMCMDDIR}\" \
&& \"./${STEAMCMDDIR}/steamcmd.sh\" +quit \
&& ln -s \"${STEAMCMDDIR}/linux32/steamclient.so\" \"${STEAMCMDDIR}/steamservice.so\" \
&& mkdir -p \"${HOMEDIR}/.steam/sdk32\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamclient.so\" \"${HOMEDIR}/.steam/sdk32/steamclient.so\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamcmd\" \"${STEAMCMDDIR}/linux32/steam\" \
&& mkdir -p \"${HOMEDIR}/.steam/sdk64\" \
&& ln -s \"${STEAMCMDDIR}/linux64/steamclient.so\" \"${HOMEDIR}/.steam/sdk64/steamclient.so\" \
&& ln -s \"${STEAMCMDDIR}/linux64/steamcmd\" \"${STEAMCMDDIR}/linux64/steam\" \
&& ln -s \"${STEAMCMDDIR}/steamcmd.sh\" \"${STEAMCMDDIR}/steam.sh\"" \
# Symlink steamclient.so; So misconfigured dedicated servers can find it
&& ln -s "${STEAMCMDDIR}/linux64/steamclient.so" "/usr/lib/x86_64-linux-gnu/steamclient.so" \
&& rm -rf /var/lib/apt/lists/*
COPY etc/entry.sh "${HOMEDIR}/entry.sh"
# Switch to user
USER ${USER}
WORKDIR ${HOMEDIR}
CMD ["bash", "entry.sh"]
# Expose ports
EXPOSE 7779/udp \
27017/udp \
20560/udp \
8080/tcp