2022-11-08 16:34:58 +01:00
|
|
|
ARG DOCKER_IMAGE=alpine:3.16
|
2021-06-21 19:55:38 +02:00
|
|
|
FROM $DOCKER_IMAGE AS builder
|
2020-04-12 11:00:56 +02:00
|
|
|
|
|
|
|
ENV MINETEST_GAME_VERSION master
|
2021-04-02 09:26:03 +02:00
|
|
|
ENV IRRLICHT_VERSION master
|
2020-04-12 11:00:56 +02:00
|
|
|
|
2021-09-01 02:32:31 +02:00
|
|
|
RUN apk add --no-cache git build-base cmake sqlite-dev curl-dev zlib-dev zstd-dev \
|
2022-11-08 16:34:58 +01:00
|
|
|
gmp-dev jsoncpp-dev postgresql-dev ninja luajit-dev ca-certificates
|
2020-04-27 08:31:37 +02:00
|
|
|
|
|
|
|
WORKDIR /usr/src/
|
|
|
|
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
|
2022-02-01 01:42:24 +01:00
|
|
|
cd prometheus-cpp && \
|
|
|
|
cmake -B build \
|
2020-04-27 08:31:37 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2021-06-21 19:55:38 +02:00
|
|
|
-DENABLE_TESTING=0 \
|
|
|
|
-GNinja && \
|
2022-02-01 01:42:24 +01:00
|
|
|
cmake --build build && \
|
|
|
|
cmake --install build
|
2020-04-27 08:31:37 +02:00
|
|
|
|
2021-04-02 09:26:03 +02:00
|
|
|
RUN git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
|
2021-04-02 12:25:52 +02:00
|
|
|
cp -r irrlicht/include /usr/include/irrlichtmt
|
2021-04-02 09:26:03 +02:00
|
|
|
|
2022-11-08 16:34:58 +01:00
|
|
|
COPY .git /usr/src/minetest/.git
|
|
|
|
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
|
|
|
|
COPY README.md /usr/src/minetest/README.md
|
|
|
|
COPY minetest.conf.example /usr/src/minetest/minetest.conf.example
|
|
|
|
COPY builtin /usr/src/minetest/builtin
|
|
|
|
COPY cmake /usr/src/minetest/cmake
|
|
|
|
COPY doc /usr/src/minetest/doc
|
|
|
|
COPY fonts /usr/src/minetest/fonts
|
|
|
|
COPY lib /usr/src/minetest/lib
|
|
|
|
COPY misc /usr/src/minetest/misc
|
|
|
|
COPY po /usr/src/minetest/po
|
|
|
|
COPY src /usr/src/minetest/src
|
|
|
|
COPY textures /usr/src/minetest/textures
|
|
|
|
|
2020-04-27 08:31:37 +02:00
|
|
|
WORKDIR /usr/src/minetest
|
2022-11-08 16:34:58 +01:00
|
|
|
RUN git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
|
|
|
|
rm -fr ./games/minetest_game/.git && \
|
|
|
|
cmake -B build \
|
2020-04-12 11:00:56 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DBUILD_SERVER=TRUE \
|
2020-04-27 08:31:37 +02:00
|
|
|
-DENABLE_PROMETHEUS=TRUE \
|
2020-04-16 20:43:49 +02:00
|
|
|
-DBUILD_UNITTESTS=FALSE \
|
2021-06-21 19:55:38 +02:00
|
|
|
-DBUILD_CLIENT=FALSE \
|
|
|
|
-GNinja && \
|
2022-02-01 01:42:24 +01:00
|
|
|
cmake --build build && \
|
|
|
|
cmake --install build
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2022-11-08 16:34:58 +01:00
|
|
|
ARG DOCKER_IMAGE=alpine:3.16
|
2021-06-21 19:55:38 +02:00
|
|
|
FROM $DOCKER_IMAGE AS runtime
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2021-09-07 15:29:57 +02:00
|
|
|
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit jsoncpp zstd-libs && \
|
2020-04-12 11:00:56 +02:00
|
|
|
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
|
|
|
|
chown -R minetest:minetest /var/lib/minetest
|
2018-12-12 00:00:08 +01:00
|
|
|
|
|
|
|
WORKDIR /var/lib/minetest
|
|
|
|
|
2021-06-21 19:55:38 +02:00
|
|
|
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
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-04-12 11:00:56 +02:00
|
|
|
USER minetest:minetest
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-04-27 08:31:37 +02:00
|
|
|
EXPOSE 30000/udp 30000/tcp
|
2022-11-08 16:34:58 +01:00
|
|
|
VOLUME /var/lib/minetest/ /etc/minetest/
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2022-11-08 16:34:58 +01:00
|
|
|
ENTRYPOINT ["/usr/local/bin/minetestserver"]
|
|
|
|
CMD ["--config", "/etc/minetest/minetest.conf"]
|