2
0

Dockerfile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. FROM debian:stretch
  2. USER root
  3. RUN apt-get update -y && \
  4. apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev \
  5. libsqlite3-dev libcurl4-gnutls-dev zlib1g-dev libgmp-dev libjsoncpp-dev git && \
  6. apt-get clean && rm -rf /var/cache/apt/archives/* && \
  7. rm -rf /var/lib/apt/lists/*
  8. COPY . /usr/src/minetest
  9. RUN mkdir -p /usr/src/minetest/cmakebuild && cd /usr/src/minetest/cmakebuild && \
  10. cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE \
  11. -DBUILD_SERVER=TRUE \
  12. -DBUILD_CLIENT=FALSE \
  13. -DENABLE_SYSTEM_JSONCPP=1 \
  14. .. && \
  15. make -j2 && \
  16. rm -Rf ../games/minetest_game && git clone https://github.com/minetest/minetest_game ../games/minetest_game && \
  17. make install
  18. FROM debian:stretch
  19. USER root
  20. RUN groupadd minetest && useradd -m -g minetest -d /var/lib/minetest minetest && \
  21. apt-get update -y && \
  22. apt-get -y install libcurl3-gnutls libjsoncpp1 liblua5.1-0 libluajit-5.1-2 libpq5 libsqlite3-0 \
  23. libstdc++6 zlib1g libc6
  24. WORKDIR /var/lib/minetest
  25. COPY --from=0 /usr/local/share/minetest /usr/local/share/minetest
  26. COPY --from=0 /usr/local/bin/minetestserver /usr/local/bin/minetestserver
  27. COPY --from=0 /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
  28. USER minetest
  29. EXPOSE 30000/udp
  30. CMD ["/usr/local/bin/minetestserver", "--config", "/etc/minetest/minetest.conf"]