-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·75 lines (58 loc) · 2.08 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
64
65
66
67
68
69
70
71
72
73
74
75
ARG APPDIR="/root/hlds"
ARG APPID="90"
ARG MOD="valve"
FROM debian:trixie-slim AS build_stage
ARG APPDIR
ARG APPID
ARG MOD
ARG APPBRANCH=""
LABEL creator="Sergey Shorokhov <wopox1337@ya.ru>"
# Install required packages
RUN set -x \
&& apt update \
&& apt install -y --no-install-recommends --no-install-suggests \
ca-certificates=20240203 \
curl=8.5.0-2 \
libarchive-tools=3.7.2-1 \
&& rm -rf /var/lib/apt/lists/*
# Download and install DepotDownloader
ARG DepotDownloader_URL="https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.5.0/DepotDownloader-linux-x64.zip"
RUN curl -L# ${DepotDownloader_URL} | bsdtar -xvf - -C /usr/local/bin/ \
&& chmod +x /usr/local/bin/DepotDownloader
COPY --chmod=755 utils/* utils/
# Download mod depots
RUN DEPOTS=$(utils/getDepotsByMod.sh ${MOD}) \
&& for depot in ${DEPOTS}; do \
DepotDownloader -dir ${APPDIR} -app ${APPID} -depot ${depot} -beta ${APPBRANCH}; \
done \
&& rm -rf ${APPDIR}/.DepotDownloader
# Fix first run crash and STEAM Validation rejected issue
RUN cp ${APPDIR}/${MOD}/steam_appid.txt ${APPDIR}
# Remove unnecessary files
RUN rm -rf ${APPDIR}/linux64 \
&& find ${APPDIR} \( \
-name '*64.so' -o \
-name '*.dll' -o \
-name '*.dylib' \
\) -exec rm -rf {} \;
FROM debian:trixie-slim AS run_stage
# Install required packages
RUN set -x \
&& apt update \
&& apt install -y --no-install-recommends --no-install-suggests \
ca-certificates=20240203 \
gdb-minimal=13.2-1 \
lib32stdc++6=14-20240201-3 \
&& rm -rf /var/lib/apt/lists/*
ARG APPDIR
# Copy HLDS files from build stage
COPY --from=build_stage ${APPDIR} ${APPDIR}
# Create symbolic links for steamclient.so
RUN mkdir -p ~/.steam/sdk32/ \
&& ln -s ${APPDIR}/steamclient.so ~/.steam/sdk32/steamclient.so \
&& ln -s ${APPDIR}/steamclient.so ${APPDIR}/steamservice.so
WORKDIR ${APPDIR}
EXPOSE 27016/udp
# Set entrypoint and default command
ENTRYPOINT ["sh", "-c"]
CMD ["./hlds_run -game valve -debug +ip 0.0.0.0 -port 27016 -maxplayers 10 +map crossfire"]