forked from artkirienko/xashds-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.64bit
More file actions
115 lines (97 loc) · 3.7 KB
/
Dockerfile.64bit
File metadata and controls
115 lines (97 loc) · 3.7 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
FROM debian:bookworm-slim AS build
ARG XASHDS_GIT_REF="master" \
XASHDS_BUILD_TYPE="release" \
METAMOD_GIT_REF="master" \
METAMOD_BUILD_TYPE="linux-x64-release" \
HLSDK_GIT_REF="895b28d0" \
HLSDK_BUILD_TYPE="Release" \
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"
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 \
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} -8 -d --enable-lto --enable-openmp \
&& ./waf build \
&& ./waf install --destdir /opt/xash/xashds \
&& cd .. && rm -rf xash3d-fwgs
# Compiling hlsdk-portable
RUN git clone --recursive https://github.com/FWGS/hlsdk-portable \
&& cd hlsdk-portable \
&& git checkout ${HLSDK_GIT_REF} \
&& mkdir build && cd build \
&& cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${HLSDK_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX="/opt/xash/xashds" -D64BIT=ON \
&& cmake --build . --target all \
&& cmake --build . --target install \
&& cd ../.. && rm -rf hlsdk-portable
# Prepare directories & configuration files for Metamod
RUN sed -i 's/dlls\/hl\.so/addons\/metamod\/metamod.so/g' /opt/xash/xashds/valve/liblist.gam
# Compiling & installing Metamod-FWGS
RUN git clone --recursive https://github.com/FWGS/metamod-fwgs.git \
&& cd metamod-fwgs \
&& git checkout ${METAMOD_GIT_REF} \
&& mkdir ./build \
&& cd build \
&& cmake .. --preset ${METAMOD_BUILD_TYPE} \
&& cmake --build . --parallel $(nproc) \
&& cmake --install . --prefix /opt/xash/xashds/valve/addons/metamod
# 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
# 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-64" \
maintainer="FWGS" \
description="Xash3D FWGS dedicated server engine build (64-bit)." \
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 apt-get -y update && apt-get install -y --no-install-recommends \
ca-certificates \
openssl \
libgomp1 \
&& 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"]