-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Dockerfile
49 lines (44 loc) · 2.13 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
############################################################
# Dockerfile that contains SteamCMD
############################################################
FROM debian:bullseye-slim as build_stage
LABEL maintainer="walentinlamonos@gmail.com"
ARG PUID=1000
ENV USER steam
ENV HOMEDIR "/home/${USER}"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
lib32stdc++6=10.2.1-6 \
lib32gcc-s1=10.2.1-6 \
ca-certificates=20210119 \
nano=5.4-2+deb11u3 \
curl=7.74.0-1.3+deb11u14 \
locales=2.31-13+deb11u11 \
&& 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/*
FROM build_stage AS bullseye-root
WORKDIR ${STEAMCMDDIR}
FROM bullseye-root AS bullseye
# Switch to user
USER ${USER}