-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (52 loc) · 2.44 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
# syntax=docker/dockerfile:1
ARG MOD="valve"
ARG TAG="steam_legacy"
ARG ReHLDS_VERSION="latest"
ARG ReGameDLL_VERSION="latest"
ARG BugfixedHL_LINK="https://github.com/tmp64/BugfixedHL-Rebased/releases/download/v1.10.4/BugfixedHL-1.10.4-server.zip"
FROM debian:trixie-slim AS build_stage
LABEL creator="Sergey Shorokhov <[email protected]>"
# Install required packages
RUN set -x \
&& apt-get update \
&& apt-get 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/*
WORKDIR /usr/local/bin/
ADD --chmod=755 https://raw.githubusercontent.com/hldsdocker/rehlds/master/utils/GetGithubReleaseUrl.sh GetGithubReleaseUrl
WORKDIR /root/hlds
ARG ReHLDS_VERSION
# Install ReHLDS
RUN releaseLink=$(GetGithubReleaseUrl "dreamstalker/rehlds" ${ReHLDS_VERSION}) \
&& curl -sSL $releaseLink | bsdtar -xf - --strip-components=2 bin/linux32/* \
&& chmod +x hlds_linux hltv
SHELL [ "/bin/bash", "-c" ]
ARG MOD
# Install BugfixedHL-Rebased
RUN if [ "${MOD}" = "valve" ] && [ "${#BugfixedHL_LINK}" -gt 0 ]; then \
releaseLink=${BugfixedHL_LINK} \
&& curl -sSL $releaseLink | bsdtar -xf - -C ${MOD}/ --strip-components=2 --exclude='*.dll' --exclude='*.pdb' BugfixedHL*server/valve_addon/dlls/*; \
fi
ARG ReGameDLL_VERSION
ARG ReGameDLL_Bots_URL="https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/extra/zBot/bot_profiles.zip?raw=true"
# Install ReGameDLL_CS
RUN if [ "${MOD}" = "cstrike" ] || [ "${MOD}" = "czero" ]; then \
releaseLink=$(GetGithubReleaseUrl "s1lentq/ReGameDLL_CS" ${ReGameDLL_VERSION}) \
&& curl -sSL $releaseLink | bsdtar -xf - --strip-components=2 bin/linux32/*; \
if [ "${MOD}" = "czero" ]; then \
mv cstrike czero ; \
else \
curl -sSL ${ReGameDLL_Bots_URL} | bsdtar -xf - cstrike/ ;\
fi \
fi
FROM hldsdocker/${MOD}:${TAG} AS run_stage
COPY --chown=${APPUSER}:${APPUSER} --chmod=755 --from=build_stage /root/hlds .
ARG BugfixedHL_LINK
# Hotfix for server startup on BugfixedHL-Rebased
RUN if [ "${MOD}" = "valve" ] && [ "${#BugfixedHL_LINK}" -gt 0 ]; then \
rm -rf libstdc++.so.6 libgcc_s.so.1 ; \
fi
# Set default command
CMD ["bash", "-c", "./hlds_run -game ${MOD} $([ '$MOD' = 'cstrike' ] && echo '-bots' || echo '') -bots +ip 0.0.0.0 -port 27016 +map $(grep -oE '^\\s*(\\w+)' ./${MOD}/mapcycle.txt | head -n 1 | xargs)"]