-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·73 lines (65 loc) · 1.82 KB
/
Dockerfile
File metadata and controls
executable file
·73 lines (65 loc) · 1.82 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## Pull our base image
FROM debian:13-slim
## Image Information
LABEL maintainer="Jeff Nelson <jeff@netwar.org>"
ARG DEBIAN_FRONTEND=noninteractive
## Set Build Arguments
ENV APP_DIR="/app" \
GAME_DIR="/app/rust" \
GAME_USER="steam" \
STEAMCMD_APP="258550" \
STEAMCMD_USER="anonymous" \
STEAMCMD_PASSWORD="" \
STEAMCMD_AUTH_CODE="" \
STEAMCMD_DIR="/app/steamcmd"
## Start building our server
RUN apt update \
&& apt install -y \
curl \
expect \
lib32gcc-s1 \
lib32stdc++6 \
lib32z1 \
libc6 \
libgdiplus \
libncurses6 \
libsdl2-2.0-0 \
libtinfo6 \
net-tools \
sqlite3 \
tcl \
unzip \
wget \
zlib1g \
&& apt clean \
&& rm -rf /var/tmp/* /var/lib/apt/lists/* /tmp/* \
\
## Create Directory Structure
&& mkdir -p $GAME_DIR \
&& mkdir -p $STEAMCMD_DIR \
\
## Create our User
&& useradd -ms /bin/bash $GAME_USER \
\
## Set Directory Permissions
&& chown -R $GAME_USER:$GAME_USER $GAME_DIR \
&& chown -R $GAME_USER:$GAME_USER $STEAMCMD_DIR
## Change to our User
USER $GAME_USER
## Download SteamCMD
RUN curl -s https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xzC $STEAMCMD_DIR \
&& $STEAMCMD_DIR/steamcmd.sh \
+@sSteamCmdForcePlatformType linux \
+login $STEAMCMD_USER $STEAMCMD_PASSWORD $STEAMCMD_AUTH_CODE \
+quit \
\
## Create symlinks and appid for Steam
&& mkdir -p ~/.steam/sdk64 \
&& ln -s $STEAMCMD_DIR/linux64/steamclient.so ~/.steam/sdk64/steamclient.so \
&& echo "$STEAMCMD_APP" > $GAME_DIR/steam_appid.txt
## Copy our run script into the image
COPY run.sh $APP_DIR/run.sh
## Set working directory
WORKDIR $APP_DIR
## Start the run script
CMD ["bash", "run.sh"]