diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cdb1a82 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.github +.gitattributes +READMETEMPLATE.md +README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..c73c33b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f6a6381 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96374c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/Dockerfile b/Dockerfile index a41a532..44ca979 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,85 +1,111 @@ -FROM linuxserver/baseimage - -MAINTAINER Sparklyballs - +FROM lsiobase/alpine +MAINTAINER sparklyballs # set version label ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -ENV APTLIST="libbz2-dev lua-socket libleveldb-dev luajit libluajit-5.1-dev libsqlite3-dev \ -libcurl4-gnutls-dev libfreetype6-dev libhiredis0.10 libjsoncpp-dev" +# environment variables +ENV HOME="/config" \ +MINETEST_SUBGAME_PATH="/config/.minetest/games -ENV BUILD_APTLIST="build-essential git-core gettext cmake doxygen libirrlicht-dev libjpeg-dev libxxf86vm-dev libogg-dev libvorbis-dev libopenal-dev zlib1g-dev libgmp-dev libpng12-dev libgl1-mesa-dev libhiredis-dev" +# build variables +ARG LDFLAGS="-lintl" -# Set environment variables -ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 MINETEST_SUBGAME_PATH="/config/.minetest/games" +# install build packages +RUN \ + apk add --no-cache --virtual=build-dependencies \ + bzip2-dev \ + cmake \ + curl-dev \ + doxygen \ + g++ \ + gcc \ + gettext-dev \ + git \ + gmp-dev \ + hiredis-dev \ + icu-dev \ + irrlicht-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + libtool \ + luajit-dev \ + make \ + openal-soft-dev \ + openssl-dev \ + python-dev \ + sqlite-dev && \ -ENV configOPTS="-DENABLE_GETTEXT=TRUE \ --DENABLE_SOUND=FALSE \ --DENABLE_LUAJIT=TRUE \ --DENABLE_CURL=TRUE \ --DENABLE_REDIS=TRUE \ --DENABLE_GETTEXT=TRUE \ --DENABLE_SYSTEM_GMP=TRUE \ --DENABLE_LEVELDB=TRUE \ --DRUN_IN_PLACE=FALSE \ --DBUILD_SERVER=TRUE " +apk add --no-cache --virtual=build-dependencies \ + --repository http://nl.alpinelinux.org/alpine/edge/testing \ + leveldb-dev && \ +# install runtime packages + apk add --no-cache \ + curl \ + gmp \ + hiredis \ + libgcc \ + libintl \ + libstdc++ \ + luajit \ + lua-socket \ + sqlite \ + sqlite-libs && \ -# Set the locale -RUN locale-gen en_US.UTF-8 && \ +apk add --no-cache \ + --repository http://nl.alpinelinux.org/alpine/edge/testing \ + leveldb && \ -# update apt and install build dependencies -apt-get update -q && \ -apt-get install \ ---no-install-recommends \ -$APTLIST \ -$BUILD_APTLIST -qy && \ +# compile spatialindex + git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex && \ + cd /tmp/spatialindex && \ + cmake . \ + -DCMAKE_INSTALL_PREFIX=/usr && \ + make && \ + make install && \ -# clone minitest git repository -cd /tmp && \ -git clone --depth 1 https://github.com/minetest/minetest.git && \ -cd /tmp/minetest && \ -cp minetest.conf.example /defaults/minetest.conf && \ +# compile minetestserver + git clone --depth 1 https://github.com/minetest/minetest.git /tmp/minetest && \ + cp /tmp/minetest//minetest.conf.example /defaults/minetest.conf && \ + cd /tmp/minetest && \ + cmake . \ + -DBUILD_CLIENT=0 \ + -DBUILD_SERVER=1 \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCUSTOM_BINDIR=/usr/bin \ + -DCUSTOM_DOCDIR="/usr/share/doc/minetest" \ + -DCUSTOM_SHAREDIR="/usr/share/minetest" \ + -DENABLE_CURL=1 \ + -DENABLE_GETTEXT=1 \ + -DENABLE_LEVELDB=1 \ + -DENABLE_LUAJIT=1 \ + -DENABLE_REDIS=1 \ + -DENABLE_SOUND=0 \ + -DENABLE_SYSTEM_GMP=1 \ + -DRUN_IN_PLACE=0 && \ + make && \ + make install && \ -# build and configure minitest -cmake . \ -$configOPTS && \ -make && \ -make install && \ +# copy games to temporary folder + mkdir -p \ + /defaults/games && \ + cp -pr /usr/share/minetest/games/* /defaults/games/ && \ -# copy games to temporary folder -mkdir -p /defaults/games && \ -cp -pr /usr/local/share/minetest/games/* /defaults/games/ && \ +# fetch additional game from git + git clone --depth 1 https://github.com/minetest/minetest_game.git /defaults/games/minetest && \ -# fetch additional game from git -git clone --depth 1 https://github.com/minetest/minetest_game.git /defaults/games/minetest && \ +# cleanup + apk del --purge \ + build-dependencies && \ + rm -rf \ + /tmp/* -# clean build dependencies -apt-get purge --remove \ -$BUILD_APTLIST -qy && \ -apt-get autoremove -y && \ +# add local files +COPY root / -# install runtime dependencies (makes sure we haven't deleted needed packages with removal above) -apt-get install \ ---no-install-recommends \ -$APTLIST -qy && \ - -#clean up -cd / && \ -apt-get clean && \ -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# add some files -ADD services/ /etc/service/ -ADD init/ /etc/my_init.d/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh - -# set volume -VOLUME /config/.minetest - -# expose port +# ports and volumes EXPOSE 30000/udp - +VOLUME /config/.minetest diff --git a/README.md b/README.md index d6f1a31..8597771 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,49 @@ -![https://linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png) +[linuxserverurl]: https://linuxserver.io +[forumurl]: https://forum.linuxserver.io +[ircurl]: https://www.linuxserver.io/irc/ +[podcasturl]: https://www.linuxserver.io/podcast/ -The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring easy user mapping and community support. Find us for support at: -* [forum.linuxserver.io](https://forum.linuxserver.io) -* [IRC](https://www.linuxserver.io/irc/) on freenode at `#linuxserver.io` -* [Podcast](https://www.linuxserver.io/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] -# lsiodev/minetest -![](https://raw.githubusercontent.com/linuxserver/beta-templates/master/lsiodev/img/minetest-icon.png) +The [LinuxServer.io][linuxserverurl] team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io][forumurl] +* [IRC][ircurl] on freenode at `#linuxserver.io` +* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! -Minetest is a near-infinite-world block sandbox game and a game engine, inspired by InfiniMiner, Minecraft, and the like. [Minetest](http://www.minetest.net/) +# linuxserver/minetest +[![](https://images.microbadger.com/badges/version/linuxserver/minetest.svg)](https://microbadger.com/images/linuxserver/minetest "Get your own version badge on microbadger.com")[![](https://images.microbadger.com/badges/image/linuxserver/minetest.svg)](http://microbadger.com/images/linuxserver/minetest "Get your own image badge on microbadger.com")[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/minetest.svg)][hub][![Docker Stars](https://img.shields.io/docker/stars/linuxserver/minetest.svg)][hub][![Build Status](http://jenkins.linuxserver.io:8080/buildStatus/icon?job=Dockers/LinuxServer.io/linuxserver-minetest)](http://jenkins.linuxserver.io:8080/job/Dockers/job/LinuxServer.io/job/linuxserver-minetest/) +[hub]: https://hub.docker.com/r/linuxserver/minetest/ +[Minetest][mineurl] (server) is a near-infinite-world block sandbox game and a game engine, inspired by InfiniMiner, Minecraft, and the like. + +[![minetest](https://raw.githubusercontent.com/linuxserver/beta-templates/master/lsiodev/img/minetest-icon.png)][mineurl] +[mineurl]: http://www.minetest.net/ ## Usage ``` -docker create --name=minetest -v :/config/.minetest \ --e PGID= -e PUID= -e TZ= \ --p 30000:30000/udp lsiodev/minetest +docker create \ + --name=minetest \ + -v :/config/.minetest \ + -e PGID= -e PUID= \ + -p 30000:30000/udp + linuxserver/minetest ``` -**Parameters** +## Parameters + +`The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. +For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. +So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 +http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.` + + * `-p 30000/udp` - the port(s) * `-v /config/.minetest` - where minetest stores config files and maps etc. * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation -* `-e TZ` for Timezone setting, eg Europe/London - -It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it minetest /bin/bash`. +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it minetest /bin/bash`. ### User / Group Identifiers @@ -40,21 +56,28 @@ In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as bel uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) ``` -## Setting up the application +## Setting up the application You can find the world maps, mods folder and config files in /config/.minetest. +## Info -## Logs and shell -* To monitor the logs of the container in realtime `docker logs -f minetest`. * Shell access whilst the container is running: `docker exec -it minetest /bin/bash` +* To monitor the logs of the container in realtime: `docker logs -f minetest` +* container version number +`docker inspect -f '{{ index .Config.Labels "build_version" }}' minetest` + +* image version number + +`docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/minetest` ## Versions + ++ **25.11.2016:** Rebase to alpine linux, move to main repo. + **27.02.2016:** Bump to latest version. + **19.02.2016:** Change port to UDP, thanks to slashopt for pointing this out. + **15.02.2016:** Make minetest app a service. + **01-02-2016:** Add lua-socket dependency. + **06.11.2015:** Initial Release. - diff --git a/init/05-fix-the-time.sh b/init/05-fix-the-time.sh deleted file mode 100644 index 865736e..0000000 --- a/init/05-fix-the-time.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [[ $(cat /etc/timezone) != $TZ ]] ; then - echo "$TZ" > /etc/timezone - exec dpkg-reconfigure -f noninteractive tzdata -fi diff --git a/init/30_set_the_config.sh b/root/etc/cont-init.d/30-config similarity index 56% rename from init/30_set_the_config.sh rename to root/etc/cont-init.d/30-config index b68a37a..bef8dab 100644 --- a/init/30_set_the_config.sh +++ b/root/etc/cont-init.d/30-config @@ -1,9 +1,12 @@ -#!/bin/bash +#!/usr/bin/with-contenv bash -mkdir -p /config/.minetest/games /config/.minetest/mods +# make our folders +mkdir -p \ + /config/.minetest/games \ + /config/.minetest/mods \ + /config/.minetest/main-config if [ ! -f "/config/.minetest/main-config/minetest.conf" ]; then -mkdir -p /config/.minetest/main-config cp /defaults/minetest.conf /config/.minetest/main-config/minetest.conf fi @@ -11,4 +14,6 @@ if [ ! -d "/config/.minetest/games/minimal" ]; then cp -pr /defaults/games/* /config/.minetest/games/ fi -chown -R abc:abc /config/.minetest +# permissions +chown -R abc:abc \ + /config diff --git a/services/minetest/run b/root/etc/services.d/minetest/run similarity index 52% rename from services/minetest/run rename to root/etc/services.d/minetest/run index 3c79348..c80e621 100644 --- a/services/minetest/run +++ b/root/etc/services.d/minetest/run @@ -1,7 +1,8 @@ -#!/bin/bash +#!/usr/bin/with-contenv bash # predefine some variables world_part="--world " +# shellcheck disable=SC2154 world_set=$world # set world_string variable to use user-defined world or default world. @@ -10,5 +11,8 @@ world_string=" " else world_string=$world_part$world_set fi -exec /sbin/setuser abc minetestserver $world_string --config /config/.minetest/main-config/minetest.conf --port 30000 +# shellcheck disable=SC2086 +exec \ + s6-setuidgid abc minetestserver $world_string \ + --config /config/.minetest/main-config/minetest.conf --port 30000