-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
107 lines (89 loc) · 4.82 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
# SPDX-FileCopyrightText: 2020 - 2024 Daniel Wolf <nephatrine@gmail.com>
#
# SPDX-License-Identifier: ISC
# hadolint ignore=DL3007
FROM code.nephatrine.net/nephnet/nxb-alpine:latest AS builder
# hadolint ignore=DL3018
RUN apk add --no-cache mesa-dev sdl2-dev
ARG YQUAKE2_VERSION=QUAKE2_8_41
RUN git -C /root clone -b "$YQUAKE2_VERSION" --single-branch --depth=1 https://github.com/yquake2/yquake2.git
WORKDIR /root/yquake2
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) server game
ARG CTF_VERSION=CTF_1_10
RUN git -C /root clone -b "$CTF_VERSION" --single-branch --depth=1 https://github.com/yquake2/ctf.git
WORKDIR /root/ctf
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 ))
ARG XATRIX_VERSION=XATRIX_2_13
RUN git -C /root clone -b "$XATRIX_VERSION" --single-branch --depth=1 https://github.com/yquake2/xatrix.git
WORKDIR /root/xatrix
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 ))
ARG ROGUE_VERSION=ROGUE_2_12
RUN git -C /root clone -b "$ROGUE_VERSION" --single-branch --depth=1 https://github.com/yquake2/rogue.git
WORKDIR /root/rogue
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 ))
RUN git -C /root clone --single-branch --depth=1 https://github.com/yquake2/zaero.git
WORKDIR /root/zaero
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 ))
RUN git -C /root clone --single-branch --depth=1 https://github.com/yquake2/pakextract.git
WORKDIR /root/pakextract
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 ))
RUN git -C /root clone --single-branch --depth=1 https://github.com/DirtBagXon/3zb2-zigflag.git \
&& if [ ! "$(uname -m)" = "x86_64" ]; then sed -i "s~-msse2 -mfpmath=sse~~g" /root/3zb2-zigflag/Makefile; fi
WORKDIR /root/3zb2-zigflag
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) \
&& mv 3zb2/pak10.pak 3zb2/pak6.pak
RUN git -C /root clone --single-branch --depth=1 https://github.com/QwazyWabbitWOS/lmctf60.git \
&& sed -i 's~ldd -r~ldd~g' /root/lmctf60/GNUmakefile
WORKDIR /root/lmctf60
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) \
&& mv game*.so game.so
RUN git -C /root clone --single-branch --depth=1 https://github.com/skullernet/openffa.git
WORKDIR /root/openffa
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) \
&& mv game*.so game.so
# hadolint ignore=SC2016
RUN git -C /root clone --single-branch --depth=1 https://github.com/packetflinger/opentdm.git \
&& sed -i "s~shell pkg-config libcurl --cflags~shell curl-config --cflags~g" /root/opentdm/Makefile \
&& sed -i "s~shell pkg-config libcurl --libs~shell curl-config --libs~g" /root/opentdm/Makefile \
&& sed -i "s~-DCURL_STATICLIB~~g" /root/opentdm/Makefile \
&& sed -i 's~deps/[^ ]*~$(CURL_LIBS)~g' /root/opentdm/Makefile
WORKDIR /root/opentdm
RUN make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) \
&& mv game*.so game.so
# ------------------------------
# hadolint ignore=DL3007
FROM code.nephatrine.net/nephnet/alpine-s6:latest
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
# hadolint ignore=DL3018
RUN apk add --no-cache curl libcurl screen sdl2 \
&& mkdir -p /mnt/shared /mnt/mirror \
&& rm -rf /tmp/* /var/tmp/*
COPY --from=builder /root/pakextract/pakextract /usr/local/bin/
COPY --from=builder /root/yquake2/release/ /opt/quake2/
COPY --from=builder /root/yquake2/stuff/yq2.cfg /opt/quake2-data/baseq2/
COPY --from=builder /root/yquake2/stuff/mapfixes/baseq2/ /opt/quake2-data/baseq2/maps/
COPY --from=builder /root/yquake2/stuff/mapfixes/juggernaut/ /opt/quake2-data/jugfull/maps/
COPY --from=builder /root/ctf/release/ /opt/quake2/ctf/
COPY --from=builder /root/xatrix/release/ /opt/quake2/xatrix/
COPY --from=builder /root/xatrix/stuff/mapfixes/ /opt/quake2-data/xatrix/maps/
COPY --from=builder /root/rogue/release/ /opt/quake2/rogue/
COPY --from=builder /root/rogue/stuff/mapfixes/ /opt/quake2-data/rogue/maps/
COPY --from=builder /root/zaero/release/ /opt/quake2/zaero/
COPY --from=builder /root/zaero/stuff/mapfixes/ /opt/quake2-data/zaero/maps/
COPY --from=builder /root/3zb2-zigflag/release/ /opt/quake2/3zb2/
COPY --from=builder /root/3zb2-zigflag/3zb2/ /opt/quake2-data/3zb2/
COPY --from=builder /root/openffa/game.so /opt/quake2/openffa/
COPY --from=builder /root/opentdm/game.so /opt/quake2/opentdm/
COPY --from=builder /root/lmctf60/game.so /opt/quake2/lmctf/
COPY override /
RUN echo "====== PREP FOR Q2ADMIN ======" \
&& cp /opt/quake2/baseq2/game.so /opt/quake2/baseq2/game.real.so \
&& cp /opt/quake2/ctf/game.so /opt/quake2/ctf/game.real.so \
&& cp /opt/quake2/xatrix/game.so /opt/quake2/xatrix/game.real.so \
&& cp /opt/quake2/rogue/game.so /opt/quake2/rogue/game.real.so \
&& cp /opt/quake2/zaero/game.so /opt/quake2/zaero/game.real.so \
&& cp /opt/quake2/3zb2/game.so /opt/quake2/3zb2/game.real.so \
&& cp /opt/quake2/openffa/game.so /opt/quake2/openffa/game.real.so \
&& cp /opt/quake2/opentdm/game.so /opt/quake2/opentdm/game.real.so \
&& cp /opt/quake2/lmctf/game.so /opt/quake2/lmctf/game.real.so
EXPOSE 27910/udp