forked from artkirienko/xashds-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
135 lines (116 loc) · 4.81 KB
/
Dockerfile
File metadata and controls
135 lines (116 loc) · 4.81 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
FROM debian:bookworm-slim AS build
ARG XASHDS_GIT_REF="master" \
XASHDS_BUILD_TYPE="release" \
AMXMODX_VERSION="1.9.0-git5294" \
AMXMODX_FILENAME="amxmodx-$AMXMODX_VERSION-base-linux.tar.gz" \
AMXMODX_SHA256="b9467a63aa92fc22330c06817d9059c4462abc3ecb50d39538dda21c8f27bd58" \
AMXMODX_URL="https://www.amxmodx.org/amxxdrop/1.9/$AMXMODX_FILENAME" \
HLDS_BUILD="8308" \
HLDS_FILENAME="hlds_build_$HLDS_BUILD.zip" \
HLDS_SHA256="03a1035e6a479ccf0a64e842fe0f0315f1f2f9e0160619127a61ae68cdb37df9" \
HLDS_URL="https://github.com/DevilBoy-eXe/hlds/releases/download/$HLDS_BUILD/$HLDS_FILENAME" \
JK_BOTTI_VERSION="1.43" \
JK_BOTTI_FILENAME="jk_botti-$JK_BOTTI_VERSION-release.tar.xz" \
JK_BOTTI_SHA256="549fc87ea84d27c448a537662b0c622f8806d5657dd6bc8b6d92241b1d338767" \
JK_BOTTI_URL="http://koti.kapsi.fi/jukivili/web/jk_botti/$JK_BOTTI_FILENAME" \
METAMODR_GIT_REF="4db16ff6"
RUN groupadd -r xash && useradd -r -g xash -m -d /opt/xash xash
RUN usermod -a -G games xash
RUN apt-get -y update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
cmake \
ninja-build \
git \
g++-multilib \
lib32stdc++6 \
lib32gcc-s1 \
libc6-dev \
libc6-dev-i386 \
python3 \
unzip \
xz-utils \
zip \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
USER xash
WORKDIR /opt/xash
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Download & validate HLDS build
RUN mkdir -p /opt/xash/xashds && mkdir -p /opt/xash/xashds/valve \
&& curl -sLJO "$HLDS_URL" \
&& echo "$HLDS_SHA256 $HLDS_FILENAME" | sha256sum -c - \
&& unzip "$HLDS_FILENAME" -d "/opt/xash/hlds_build_$HLDS_BUILD" \
&& cp -R "hlds_build_$HLDS_BUILD/hlds"/valve/* xashds/valve \
&& rm -rf "hlds_build_$HLDS_BUILD" "$HLDS_FILENAME"
# Compiling XashDS from sources
RUN git clone --recursive https://github.com/FWGS/xash3d-fwgs \
&& cd xash3d-fwgs \
&& git checkout ${XASHDS_GIT_REF} \
&& ./waf configure -T ${XASHDS_BUILD_TYPE} -d --enable-lto --enable-openmp \
&& ./waf build \
&& ./waf install --destdir /opt/xash/xashds \
&& cd .. && rm -rf xash3d-fwgs
# Prepare directories & configuration files for Metamod-R
RUN mkdir -p /opt/xash/xashds/valve/addons/metamod/dlls \
&& touch /opt/xash/xashds/valve/addons/metamod/plugins.ini \
&& sed -i 's/dlls\/hl\.so/addons\/metamod\/dlls\/metamod.so/g' /opt/xash/xashds/valve/liblist.gam
# Compiling & installing Metamod-R
RUN git clone --recursive https://github.com/rehlds/Metamod-R.git \
&& cd Metamod-R \
&& git checkout ${METAMODR_GIT_REF} \
&& cp metamod/extra/config.ini /opt/xash/xashds/valve/addons/metamod/config.ini \
&& mkdir ./build \
&& cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=COMPAT_GLIBC \
&& cmake --build . --parallel $(nproc) \
&& cp metamod/metamod_i386.so /opt/xash/xashds/valve/addons/metamod/dlls/metamod.so
# Fix warnings:
# couldn't exec listip.cfg
# couldn't exec banned.cfg
RUN touch /opt/xash/xashds/valve/listip.cfg
RUN touch /opt/xash/xashds/valve/banned.cfg
# Install AMX Mod X
RUN curl -sLO "$AMXMODX_URL" \
&& echo "$AMXMODX_SHA256 $AMXMODX_FILENAME" | sha256sum -c - \
&& tar -C /opt/xash/xashds/valve/ -zxvf "$AMXMODX_FILENAME" \
&& echo 'linux addons/amxmodx/dlls/amxmodx_mm_i386.so' >> /opt/xash/xashds/valve/addons/metamod/plugins.ini \
&& rm -f "$AMXMODX_FILENAME"
RUN cat /opt/xash/xashds/valve/mapcycle.txt >> /opt/xash/xashds/valve/addons/amxmodx/configs/maps.ini
# Install jk_botti
RUN curl -sLO "$JK_BOTTI_URL" \
&& echo "$JK_BOTTI_SHA256 $JK_BOTTI_FILENAME" | sha256sum -c - \
&& tar -C /opt/xash/xashds/valve/ -xJf "$JK_BOTTI_FILENAME" \
&& rm -f "$JK_BOTTI_FILENAME" \
&& echo 'linux addons/jk_botti/dlls/jk_botti_mm_i386.so' >> /opt/xash/xashds/valve/addons/metamod/plugins.ini
# Copy default config
WORKDIR /opt/xash/xashds
COPY valve valve
# Second stage, used for running compiled XashDS
FROM debian:bookworm-slim AS final
LABEL name="xashds-docker" \
maintainer="FWGS" \
description="Xash3D FWGS dedicated server engine build." \
url="https://github.com/FWGS" \
org.label-schema.vcs-url="https://github.com/FWGS/xashds-docker" \
org.opencontainers.image.source="https://github.com/FWGS/xashds-docker"
ENV XASH3D_BASEDIR=/xashds
RUN dpkg --add-architecture i386
RUN apt-get -y update && apt-get install -y --no-install-recommends \
lib32gcc-s1 \
lib32stdc++6 \
libgomp1:i386 \
ca-certificates \
openssl \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd xashds && useradd -m -g xashds xashds
USER xashds
WORKDIR /xashds
COPY --chown=xashds:xashds --from=build /opt/xash/xashds .
EXPOSE 27015/udp
# Start server
ENTRYPOINT ["./xash", "+ip", "0.0.0.0", "-port", "27015"]
# Default start parameters
CMD ["+map crossfire"]