mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Add missing optional dependencies to Container Image (#12914)
This commit is contained in:
parent
b85831e389
commit
aa3505a9e4
68
Dockerfile
68
Dockerfile
@ -3,23 +3,37 @@ FROM $DOCKER_IMAGE AS builder
|
|||||||
|
|
||||||
ENV MINETEST_GAME_VERSION master
|
ENV MINETEST_GAME_VERSION master
|
||||||
ENV IRRLICHT_VERSION master
|
ENV IRRLICHT_VERSION master
|
||||||
|
ENV SPATIALINDEX_VERSION 1.9.3
|
||||||
|
ENV LUAJIT_VERSION v2.1
|
||||||
|
|
||||||
RUN apk add --no-cache git build-base cmake sqlite-dev curl-dev zlib-dev zstd-dev \
|
RUN apk add --no-cache git build-base cmake curl-dev zlib-dev zstd-dev \
|
||||||
gmp-dev jsoncpp-dev postgresql-dev ninja luajit-dev ca-certificates
|
sqlite-dev postgresql-dev hiredis-dev leveldb-dev \
|
||||||
|
gmp-dev jsoncpp-dev ninja ca-certificates
|
||||||
|
|
||||||
WORKDIR /usr/src/
|
WORKDIR /usr/src/
|
||||||
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
|
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
|
||||||
cd prometheus-cpp && \
|
cd prometheus-cpp && \
|
||||||
cmake -B build \
|
cmake -B build \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DENABLE_TESTING=0 \
|
-DENABLE_TESTING=0 \
|
||||||
-GNinja && \
|
-GNinja && \
|
||||||
cmake --build build && \
|
cmake --build build && \
|
||||||
cmake --install build
|
cmake --install build && \
|
||||||
|
cd /usr/src/ && \
|
||||||
RUN git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
|
git clone --recursive https://github.com/libspatialindex/libspatialindex -b ${SPATIALINDEX_VERSION} && \
|
||||||
cp -r irrlicht/include /usr/include/irrlichtmt
|
cd libspatialindex && \
|
||||||
|
cmake -B build \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr/local && \
|
||||||
|
cmake --build build && \
|
||||||
|
cmake --install build && \
|
||||||
|
cd /usr/src/ && \
|
||||||
|
git clone --recursive https://luajit.org/git/luajit.git -b ${LUAJIT_VERSION} && \
|
||||||
|
cd luajit && \
|
||||||
|
make && make install && \
|
||||||
|
cd /usr/src/ && \
|
||||||
|
git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
|
||||||
|
cp -r irrlicht/include /usr/include/irrlichtmt
|
||||||
|
|
||||||
COPY .git /usr/src/minetest/.git
|
COPY .git /usr/src/minetest/.git
|
||||||
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
|
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
|
||||||
@ -37,22 +51,23 @@ COPY textures /usr/src/minetest/textures
|
|||||||
|
|
||||||
WORKDIR /usr/src/minetest
|
WORKDIR /usr/src/minetest
|
||||||
RUN git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
|
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 && \
|
rm -fr ./games/minetest_game/.git && \
|
||||||
cmake -B build \
|
cmake -B build \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DBUILD_SERVER=TRUE \
|
-DBUILD_SERVER=TRUE \
|
||||||
-DENABLE_PROMETHEUS=TRUE \
|
-DENABLE_PROMETHEUS=TRUE \
|
||||||
-DBUILD_UNITTESTS=FALSE \
|
-DBUILD_UNITTESTS=FALSE \
|
||||||
-DBUILD_CLIENT=FALSE \
|
-DBUILD_CLIENT=FALSE \
|
||||||
-GNinja && \
|
-GNinja && \
|
||||||
cmake --build build && \
|
cmake --build build && \
|
||||||
cmake --install build
|
cmake --install build
|
||||||
|
|
||||||
ARG DOCKER_IMAGE=alpine:3.16
|
ARG DOCKER_IMAGE=alpine:3.16
|
||||||
FROM $DOCKER_IMAGE AS runtime
|
FROM $DOCKER_IMAGE AS runtime
|
||||||
|
|
||||||
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit jsoncpp zstd-libs && \
|
RUN apk add --no-cache curl gmp libstdc++ libgcc libpq jsoncpp zstd-libs \
|
||||||
|
sqlite-libs postgresql hiredis leveldb && \
|
||||||
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
|
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
|
||||||
chown -R minetest:minetest /var/lib/minetest
|
chown -R minetest:minetest /var/lib/minetest
|
||||||
|
|
||||||
@ -61,7 +76,8 @@ WORKDIR /var/lib/minetest
|
|||||||
COPY --from=builder /usr/local/share/minetest /usr/local/share/minetest
|
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/bin/minetestserver /usr/local/bin/minetestserver
|
||||||
COPY --from=builder /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
|
COPY --from=builder /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
|
||||||
|
COPY --from=builder /usr/local/lib/libspatialindex* /usr/local/lib/
|
||||||
|
COPY --from=builder /usr/local/lib/libluajit* /usr/local/lib/
|
||||||
USER minetest:minetest
|
USER minetest:minetest
|
||||||
|
|
||||||
EXPOSE 30000/udp 30000/tcp
|
EXPOSE 30000/udp 30000/tcp
|
||||||
|
Loading…
Reference in New Issue
Block a user