aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile38
1 files changed, 22 insertions, 16 deletions
diff --git a/Dockerfile b/Dockerfile
index 871ca9825..8d1008fa2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,8 @@
-FROM alpine:3.11
+ARG DOCKER_IMAGE=alpine:3.14
+FROM $DOCKER_IMAGE AS builder
ENV MINETEST_GAME_VERSION master
+ENV IRRLICHT_VERSION master
COPY .git /usr/src/minetest/.git
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
@@ -18,10 +20,8 @@ COPY textures /usr/src/minetest/textures
WORKDIR /usr/src/minetest
-RUN apk add --no-cache git build-base irrlicht-dev cmake bzip2-dev libpng-dev \
- jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev \
- libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev \
- gmp-dev jsoncpp-dev postgresql-dev luajit-dev ca-certificates && \
+RUN apk add --no-cache git build-base cmake sqlite-dev curl-dev zlib-dev zstd-dev \
+ gmp-dev jsoncpp-dev postgresql-dev ninja luajit-dev ca-certificates && \
git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
rm -fr ./games/minetest_game/.git
@@ -32,9 +32,13 @@ RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
- -DENABLE_TESTING=0 && \
- make -j2 && \
- make install
+ -DENABLE_TESTING=0 \
+ -GNinja && \
+ ninja && \
+ ninja install
+
+RUN git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
+ cp -r irrlicht/include /usr/include/irrlichtmt
WORKDIR /usr/src/minetest
RUN mkdir build && \
@@ -45,21 +49,23 @@ RUN mkdir build && \
-DBUILD_SERVER=TRUE \
-DENABLE_PROMETHEUS=TRUE \
-DBUILD_UNITTESTS=FALSE \
- -DBUILD_CLIENT=FALSE && \
- make -j2 && \
- make install
+ -DBUILD_CLIENT=FALSE \
+ -GNinja && \
+ ninja && \
+ ninja install
-FROM alpine:3.11
+ARG DOCKER_IMAGE=alpine:3.14
+FROM $DOCKER_IMAGE AS runtime
-RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit && \
+RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit jsoncpp zstd-libs && \
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
chown -R minetest:minetest /var/lib/minetest
WORKDIR /var/lib/minetest
-COPY --from=0 /usr/local/share/minetest /usr/local/share/minetest
-COPY --from=0 /usr/local/bin/minetestserver /usr/local/bin/minetestserver
-COPY --from=0 /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
+COPY --from=builder /usr/local/share/minetest /usr/local/share/minetest
+COPY --from=builder /usr/local/bin/minetestserver /usr/local/bin/minetestserver
+COPY --from=builder /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
USER minetest:minetest