2024-09-21 20:14:52 +03:00
|
|
|
FROM debian:12
|
|
|
|
|
2024-09-22 02:50:10 +03:00
|
|
|
ARG gameid
|
|
|
|
|
|
|
|
RUN echo "Building image with gameid: $gameid"
|
|
|
|
|
2024-09-21 20:14:52 +03:00
|
|
|
#Update
|
|
|
|
RUN apt update -y && apt upgrade -y
|
|
|
|
|
|
|
|
RUN apt install -y wget curl unzip git g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev
|
|
|
|
|
|
|
|
#Install minetest
|
|
|
|
RUN useradd -ms /bin/bash minetest
|
|
|
|
USER minetest
|
|
|
|
WORKDIR /home/minetest
|
|
|
|
|
|
|
|
RUN git clone --depth 1 https://github.com/minetest/minetest.git minetest-source
|
|
|
|
RUN mkdir /home/minetest/minetest-source/build
|
|
|
|
WORKDIR /home/minetest/minetest-source/build
|
|
|
|
RUN cmake -DBUILD_SERVER=TRUE -DBUILD_CLIENT=FALSE -DENABLE_CURL=ON -DENABLE_CURSES=ON -DENABLE_POSTGRES=ON -DENABLE_SOUND=OFF ..
|
|
|
|
RUN make -j 6
|
|
|
|
USER root
|
|
|
|
WORKDIR /home/minetest/minetest-source/build
|
|
|
|
RUN make install
|
|
|
|
|
|
|
|
RUN mkdir -p /usr/local/share/minetest/games
|
|
|
|
|
|
|
|
USER minetest
|
|
|
|
EXPOSE 30000/udp
|
2024-09-22 02:50:10 +03:00
|
|
|
RUN echo "#!/bin/bash\n/usr/local/bin/minetestserver --gameid $gameid" > ./entrypoint.sh
|
|
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
ENTRYPOINT ["./entrypoint.sh"]
|