generated from artkirienko/hlds-docker-dproto
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
112 lines (91 loc) · 3.83 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
FROM debian:buster-slim
ARG hlds_build=8308
ARG amxmod_version=1.8.2
ARG jk_botti_version=1.43
ARG steamcmd_url=https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
ARG hlds_url="https://github.com/DevilBoy-eXe/hlds/releases/download/$hlds_build/hlds_build_$hlds_build.zip"
ARG metamod_url="https://github.com/mittorn/metamod-p/releases/download/1/metamod.so"
ARG amxmod_url="http://www.amxmodx.org/release/amxmodx-$amxmod_version-base-linux.tar.gz"
ARG jk_botti_url="http://koti.kapsi.fi/jukivili/web/jk_botti/jk_botti-$jk_botti_version-release.tar.xz"
ENV XASH3D_BASEDIR=/opt/steam/xashds
# Fix warning:
# WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'.
# International characters may not work.
RUN apt-get update && apt-get install -y --no-install-recommends \
locales=2.28-10 \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
ENV LC_ALL en_US.UTF-8
# Fix error:
# Unable to determine CPU Frequency. Try defining CPU_MHZ.
# Exiting on SPEW_ABORT
ENV CPU_MHZ=2300
RUN groupadd -r steam && useradd -r -g steam -m -d /opt/steam steam
RUN usermod -a -G games steam
RUN dpkg --add-architecture i386
RUN apt-get -y update && apt-get install -y --no-install-recommends \
build-essential=12.6 \
ca-certificates=20190110 \
cmake=3.13.4-1 \
curl=7.64.0-4+deb10u1 \
git=1:2.20.1-2+deb10u3 \
gnupg2=2.2.12-1+deb10u1 \
g++-multilib=4:8.3.0-1 \
lib32gcc1=1:8.3.0-6 \
libstdc++6:i386=8.3.0-6 \
python=2.7.16-1 \
unzip=6.0-23+deb10u1 \
xz-utils=5.2.4-1 \
zip=3.0-11+b1 \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --recursive https://github.com/FWGS/xash3d \
&& mkdir -p xash3d/build
WORKDIR /xash3d/build
RUN cmake -DXASH_DEDICATED=ON -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" ../ \
&& make \
&& make install \
&& mv engine/xash3d /usr/local/bin/xashds \
&& rm -rf /xash3d
USER steam
WORKDIR /opt/steam
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ./lib/hlds.install /opt/steam
RUN curl -sL "$steamcmd_url" | tar xzvf - \
&& ./steamcmd.sh +runscript hlds.install
RUN curl -sLJO "$hlds_url" \
&& unzip "hlds_build_$hlds_build.zip" -d "/opt/steam/hlds_build_$hlds_build" \
&& cp -R "hlds_build_$hlds_build/hlds"/* xashds/ \
&& rm -rf "hlds_build_$hlds_build" "hlds_build_$hlds_build.zip"
# Fix error that steamclient.so is missing
RUN mkdir -p "$HOME/.steam" \
&& ln -s /opt/steam/linux32 "$HOME/.steam/sdk32"
# Fix warnings:
# couldn't exec listip.cfg
# couldn't exec banned.cfg
RUN touch /opt/steam/xashds/valve/listip.cfg
RUN touch /opt/steam/xashds/valve/banned.cfg
# Install Metamod-P (for Xash3D by mittorn)
RUN mkdir -p /opt/steam/xashds/valve/addons/metamod/dlls \
&& touch /opt/steam/xashds/valve/addons/metamod/plugins.ini
RUN curl -sqL "$metamod_url" -o /opt/steam/xashds/valve/addons/metamod/dlls/metamod.so
RUN sed -i 's/dlls\/hl\.so/addons\/metamod\/dlls\/metamod.so/g' /opt/steam/xashds/valve/liblist.gam
# Install AMX mod X
RUN curl -sqL "$amxmod_url" | tar -C /opt/steam/xashds/valve/ -zxvf - \
&& echo 'linux addons/amxmodx/dlls/amxmodx_mm_i386.so' >> /opt/steam/xashds/valve/addons/metamod/plugins.ini
RUN cat /opt/steam/xashds/valve/mapcycle.txt >> /opt/steam/xashds/valve/addons/amxmodx/configs/maps.ini
# Install jk_botti
RUN curl -sqL "$jk_botti_url" | tar -C /opt/steam/xashds/valve/ -xJ \
&& echo 'linux addons/jk_botti/dlls/jk_botti_mm_i386.so' >> /opt/steam/xashds/valve/addons/metamod/plugins.ini
WORKDIR /opt/steam/xashds
RUN mv cstrike/liblist.gam cstrike/gameinfo.txt
RUN mv valve/liblist.gam valve/gameinfo.txt
# Copy default config
COPY valve valve
EXPOSE 27015
EXPOSE 27015/udp
# Start server
ENTRYPOINT ["xashds"]
# Default start parameters
CMD ["+ip 0.0.0.0", "-timeout 3", "-pingboost 1", "+rcon_password 12345678"]