forked from niclaslindstedt/nquakesv-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
82 lines (72 loc) · 1.69 KB
/
Dockerfile
File metadata and controls
82 lines (72 loc) · 1.69 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
FROM debian:12-slim as build
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /build
# Install prerequisites
RUN <<EOS sh -ex
apt-get update
apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
cmake \
curl \
gcc \
git \
libc6-dev \
make meson \
pkg-config
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
mkdir /out
EOS
# Build mvdsv
RUN <<EOS sh -ex
git clone --depth 1 https://github.com/deurk/mvdsv.git
cd mvdsv
cmake -B build .
cmake --build build
mv build/mvdsv /out
cd ..
rm -rf mvdsv
EOS
# Build ktx
RUN <<EOS sh -ex
git clone --depth 1 https://github.com/deurk/ktx.git
cd ktx
cmake -B build .
cmake --build build
mv build/qwprogs.so /out
cd ..
rm -rf ktx
EOS
FROM debian:12-slim as run
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /nquake
# Install prerequisites
RUN <<EOS sh -ex
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
dnsutils \
dos2unix \
gettext \
qstat \
unzip \
wget
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EOS
# Copy files
COPY files .
COPY --from=build /out/mvdsv /nquake/mvdsv
COPY --from=build /out/qwprogs.so /nquake/ktx/qwprogs.so
COPY scripts/healthcheck.sh /healthcheck.sh
COPY scripts/entrypoint.sh /entrypoint.sh
# Cleanup
RUN <<EOS sh -ex
find . -type f -print0 | xargs -0 dos2unix -q
find . -type f -exec chmod -f 644 "{}" \;
find . -type d -exec chmod -f 755 "{}" \;
chmod +x mvdsv ktx/mvdfinish.qws ktx/qwprogs.so
EOS
VOLUME /nquake/logs
VOLUME /nquake/media
VOLUME /nquake/demos
ENTRYPOINT ["/entrypoint.sh"]