-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.steamcmd
More file actions
54 lines (42 loc) · 1.7 KB
/
Dockerfile.steamcmd
File metadata and controls
54 lines (42 loc) · 1.7 KB
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
# Set Base Image
FROM debian:bookworm-slim
# Create user for steamcmd and gameserver
RUN useradd -m -u 1000 -U steam
# Set environment variables (User and Workdir)
ENV USER=root
ENV HOME='/home/steam'
WORKDIR $HOME
# Add non-free repository to debian.sources
COPY data/debian.sources /etc/apt/sources.list.d/debian.sources
# Update the repository and necessary packages
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends vim less ca-certificates debconf-utils locales \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
# Set environment variables (Locale)
ENV LANG='en_US.UTF-8'
ENV LANGUAGE='en_US:en'
ENV LC_ALL='en_US.UTF-8'
# Insert Steam propmt answers
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo steam steam/question select "I AGREE" | debconf-set-selections \
&& echo steam steam/license note '' | debconf-set-selections
# Add x86 architecture and install SteamCMD
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends steamcmd
# Create symlink for executable
RUN ln -s /usr/games/steamcmd /usr/bin/steamcmd
# Change user before invoking SteamCMD
USER steam
# Update SteamCMD and verify latest version
RUN steamcmd +quit
# Fix missing directories and libraries
RUN mkdir -p $HOME/.steam \
&& ln -s $HOME/.local/share/Steam/steamcmd/linux32 $HOME/.steam/sdk32 \
&& ln -s $HOME/.local/share/Steam/steamcmd/linux64 $HOME/.steam/sdk64 \
&& ln -s $HOME/.steam/sdk32/steamclient.so $HOME/.steam/sdk32/steamservice.so \
&& ln -s $HOME/.steam/sdk64/steamclient.so $HOME/.steam/sdk64/steamservice.so
# Set default command
ENTRYPOINT ["steamcmd"]