forked from niclaslindstedt/nquakesv-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
72 lines (62 loc) · 1.61 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
FROM ubuntu:22.04 as build
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /build
# Install prerequisites
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
cmake \
curl \
gcc \
git \
libc6-dev \
make meson \
pkg-config && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /out
# Build mvdsv
RUN 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
# Build ktx
RUN 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
FROM ubuntu:22.04 as run
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /nquake
# Install prerequisites
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
dnsutils \
dos2unix \
gettext \
qstat \
unzip \
wget && \
rm -rf /var/lib/apt/lists/*
# 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 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
VOLUME /nquake/logs
VOLUME /nquake/media
VOLUME /nquake/demos
ENTRYPOINT ["/entrypoint.sh"]