From 2faaa95884b53fb905b9e3acb6246f1b34fdf28f Mon Sep 17 00:00:00 2001 From: drizuid Date: Mon, 2 May 2022 11:50:07 -0400 Subject: [PATCH] Add support for changing the advertised port --- Dockerfile | 20 +++++++++++++++--- Dockerfile.aarch64 | 20 +++++++++++++++--- Dockerfile.armhf | 20 +++++++++++++++--- Jenkinsfile | 8 ++++--- README.md | 36 +++++++++++++++++++------------- package_versions.txt | 28 +++++++++++++------------ readme-vars.yml | 10 +++++++-- root/etc/services.d/minetest/run | 4 ++-- 8 files changed, 102 insertions(+), 44 deletions(-) diff --git a/Dockerfile b/Dockerfile index 996bd65..b022a9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,6 @@ RUN \ gmp-dev \ hiredis-dev \ icu-dev \ - irrlicht-dev \ jq \ leveldb-dev \ libjpeg-turbo-dev \ @@ -43,7 +42,8 @@ RUN \ ncurses-dev \ openal-soft-dev \ python3-dev \ - sqlite-dev && \ + sqlite-dev \ + zstd-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -56,7 +56,9 @@ RUN \ luajit \ lua-socket \ sqlite \ - sqlite-libs && \ + sqlite-libs \ + zstd \ + zstd-libs && \ echo "**** compile spatialindex ****" && \ git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex && \ cd /tmp/spatialindex && \ @@ -64,6 +66,18 @@ RUN \ -DCMAKE_INSTALL_PREFIX=/usr && \ make -j 2 && \ make install && \ + echo "**** compile irrlicht ****" && \ + mkdir -p /tmp/irrlicht && \ + IRRLICHT_VER=$(curl -sX GET "https://api.github.com/repos/minetest/irrlicht/releases/latest" \ + | jq -r .tag_name) && \ + curl -o /tmp/irrlicht.tar.gz \ + -L "https://github.com/minetest/irrlicht/archive/${IRRLICHT_VER}.tar.gz" && \ + tar xf /tmp/irrlicht.tar.gz -C \ + /tmp/irrlicht --strip-components=1 && \ + cd /tmp/irrlicht && \ + cmake . && \ + make -j 2 && \ + make install && \ echo "**** compile minetestserver ****" && \ if [ -z ${MINETEST_RELEASE+x} ]; then \ MINETEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/minetest/minetest/releases" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 2c9f82a..7a87503 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -28,7 +28,6 @@ RUN \ gmp-dev \ hiredis-dev \ icu-dev \ - irrlicht-dev \ jq \ leveldb-dev \ libjpeg-turbo-dev \ @@ -43,7 +42,8 @@ RUN \ ncurses-dev \ openal-soft-dev \ python3-dev \ - sqlite-dev && \ + sqlite-dev \ + zstd-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -56,7 +56,9 @@ RUN \ luajit \ lua-socket \ sqlite \ - sqlite-libs && \ + sqlite-libs \ + zstd \ + zstd-libs && \ echo "**** compile spatialindex ****" && \ git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex && \ cd /tmp/spatialindex && \ @@ -64,6 +66,18 @@ RUN \ -DCMAKE_INSTALL_PREFIX=/usr && \ make -j 2 && \ make install && \ + echo "**** compile irrlicht ****" && \ + mkdir -p /tmp/irrlicht && \ + IRRLICHT_VER=$(curl -sX GET "https://api.github.com/repos/minetest/irrlicht/releases/latest" \ + | jq -r .tag_name) && \ + curl -o /tmp/irrlicht.tar.gz \ + -L "https://github.com/minetest/irrlicht/archive/${IRRLICHT_VER}.tar.gz" && \ + tar xf /tmp/irrlicht.tar.gz -C \ + /tmp/irrlicht --strip-components=1 && \ + cd /tmp/irrlicht && \ + cmake . && \ + make -j 2 && \ + make install && \ echo "**** compile minetestserver ****" && \ if [ -z ${MINETEST_RELEASE+x} ]; then \ MINETEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/minetest/minetest/releases" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 76f1459..70a30c5 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -28,7 +28,6 @@ RUN \ gmp-dev \ hiredis-dev \ icu-dev \ - irrlicht-dev \ jq \ leveldb-dev \ libjpeg-turbo-dev \ @@ -43,7 +42,8 @@ RUN \ ncurses-dev \ openal-soft-dev \ python3-dev \ - sqlite-dev && \ + sqlite-dev \ + zstd-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache \ curl \ @@ -56,7 +56,9 @@ RUN \ luajit \ lua-socket \ sqlite \ - sqlite-libs && \ + sqlite-libs \ + zstd \ + zstd-libs && \ echo "**** compile spatialindex ****" && \ git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex && \ cd /tmp/spatialindex && \ @@ -64,6 +66,18 @@ RUN \ -DCMAKE_INSTALL_PREFIX=/usr && \ make -j 2 && \ make install && \ + echo "**** compile irrlicht ****" && \ + mkdir -p /tmp/irrlicht && \ + IRRLICHT_VER=$(curl -sX GET "https://api.github.com/repos/minetest/irrlicht/releases/latest" \ + | jq -r .tag_name) && \ + curl -o /tmp/irrlicht.tar.gz \ + -L "https://github.com/minetest/irrlicht/archive/${IRRLICHT_VER}.tar.gz" && \ + tar xf /tmp/irrlicht.tar.gz -C \ + /tmp/irrlicht --strip-components=1 && \ + cd /tmp/irrlicht && \ + cmake . && \ + make -j 2 && \ + make install && \ echo "**** compile minetestserver ****" && \ if [ -z ${MINETEST_RELEASE+x} ]; then \ MINETEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/minetest/minetest/releases" \ diff --git a/Jenkinsfile b/Jenkinsfile index 8b0f4ef..2c17776 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -345,9 +345,11 @@ pipeline { if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then cd ${TEMPDIR}/unraid/templates/ if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then - echo "Image is on the ignore list, removing Unraid template" - git rm unraid/${CONTAINER_NAME}.xml || : - git commit -m 'Bot Removing Deprecated Unraid Template' || : + echo "Image is on the ignore list, marking Unraid template as deprecated" + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add -u unraid/${CONTAINER_NAME}.xml + git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : + git commit -m 'Bot Moving Deprecated Unraid Template' || : else cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ git add unraid/${CONTAINER_NAME}.xml diff --git a/README.md b/README.md index 966768a..3354828 100644 --- a/README.md +++ b/README.md @@ -46,22 +46,26 @@ Find us at: ## Supported Architectures -Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). +We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). -Simply pulling `lscr.io/linuxserver/minetest` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. +Simply pulling `lscr.io/linuxserver/minetest:latest` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. The architectures supported by this image are: -| Architecture | Tag | -| :----: | --- | -| x86-64 | amd64-latest | -| arm64 | arm64v8-latest | -| armhf | arm32v7-latest | +| Architecture | Available | Tag | +| :----: | :----: | ---- | +| x86-64 | ✅ | amd64-\ | +| arm64 | ✅ | arm64v8-\ | +| armhf| ✅ | arm32v7-\ | ## Application Setup You can find the world maps, mods folder and config files in /config/.minetest. +If you want to override the advertised port, ensure you add --port in your CLI_ARGS AND ensure the internal port reflects the change, ie; +if you set your advertised port to 40000 with --port 40000 then your ports declaration should be 40000:40000/udp + + Client and server must be the same version, please browse the tags here to pull the appropriate version for your server: https://hub.docker.com/r/linuxserver/minetest/tags @@ -77,13 +81,13 @@ Here are some example snippets to help you get started creating a container. version: "2.1" services: minetest: - image: lscr.io/linuxserver/minetest + image: lscr.io/linuxserver/minetest:latest container_name: minetest environment: - PUID=1000 - PGID=1000 - TZ=Europe/London - - CLI_ARGS="--gameid minetest" #optional + - CLI_ARGS="--gameid minetest --port 30000" #optional volumes: - /path/to/data:/config/.minetest ports: @@ -99,11 +103,11 @@ docker run -d \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ - -e CLI_ARGS="--gameid minetest" `#optional` \ + -e CLI_ARGS="--gameid minetest --port 30000" `#optional` \ -p 30000:30000/udp \ -v /path/to/data:/config/.minetest \ --restart unless-stopped \ - lscr.io/linuxserver/minetest + lscr.io/linuxserver/minetest:latest ``` ## Parameters @@ -116,7 +120,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. | -| `-e CLI_ARGS="--gameid minetest"` | Optionally specify any [CLI variables](https://wiki.minetest.net/Command_line) you want to launch the app with | +| `-e CLI_ARGS="--gameid minetest --port 30000"` | Optionally specify any [CLI variables](https://wiki.minetest.net/Command_line) you want to launch the app with | | `-v /config/.minetest` | Where minetest stores config files and maps etc. | ## Environment variables from files (Docker secrets) @@ -162,7 +166,7 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to * container version number * `docker inspect -f '{{ index .Config.Labels "build_version" }}' minetest` * image version number - * `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/minetest` + * `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/minetest:latest` ## Updating Info @@ -180,7 +184,7 @@ Below are the instructions for updating containers: ### Via Docker Run -* Update the image: `docker pull lscr.io/linuxserver/minetest` +* Update the image: `docker pull lscr.io/linuxserver/minetest:latest` * Stop the running container: `docker stop minetest` * Delete the container: `docker rm minetest` * Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved) @@ -228,7 +232,9 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **19.01.21:** - Rebasing to alpine 3.15. +* **02.05.22:** - Allow specifying the advertised port. +* **17.03.22:** - Install forked irrlicht, add zstd. +* **19.01.22:** - Rebasing to alpine 3.15. * **02.06.20:** - Rebasing to alpine 3.12. * **19.12.19:** - Rebasing to alpine 3.11. * **12.07.19:** - Bugfix to support multiple CLI variables. diff --git a/package_versions.txt b/package_versions.txt index 2f1512f..48846b3 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -1,26 +1,26 @@ alpine-baselayout-3.2.0-r18 alpine-keys-2.4-r1 apk-tools-2.12.7-r3 -bash-5.1.8-r0 +bash-5.1.16-r0 brotli-libs-1.0.9-r5 -busybox-1.34.1-r3 +busybox-1.34.1-r5 ca-certificates-20211220-r0 ca-certificates-bundle-20211220-r0 coreutils-9.0-r2 -curl-7.80.0-r0 -gmp-6.2.1-r0 +curl-7.80.0-r1 +gmp-6.2.1-r1 hiredis-1.0.2-r0 leveldb-1.22-r1 libacl-2.2.53-r0 libattr-2.5.1-r1 libc-utils-0.7.2-r3 -libcrypto1.1-1.1.1l-r8 -libcurl-7.80.0-r0 +libcrypto1.1-1.1.1n-r0 +libcurl-7.80.0-r1 libgcc-10.3.1_git20211027-r0 libintl-0.21-r0 libproc-3.3.17-r0 -libretls-3.3.4-r2 -libssl1.1-1.1.1l-r8 +libretls-3.3.4-r3 +libssl1.1-1.1.1n-r0 libstdc++-10.3.1_git20211027-r0 linux-pam-1.5.2-r0 lua-socket-3.0_rc1_git20160306-r3 @@ -39,9 +39,11 @@ skalibs-2.11.0.0-r0 snappy-1.1.9-r1 sqlite-3.36.0-r0 sqlite-libs-3.36.0-r0 -ssl_client-1.34.1-r3 -tzdata-2021e-r0 +ssl_client-1.34.1-r5 +tzdata-2022a-r0 utmps-0.1.0.3-r0 -xz-5.2.5-r0 -xz-libs-5.2.5-r0 -zlib-1.2.11-r3 +xz-5.2.5-r1 +xz-libs-5.2.5-r1 +zlib-1.2.12-r1 +zstd-1.5.0-r0 +zstd-libs-1.5.0-r0 diff --git a/readme-vars.yml b/readme-vars.yml index fa04860..242856d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -36,7 +36,7 @@ cap_add_param: false # optional container parameters opt_param_usage_include_env: true opt_param_env_vars: - - { env_var: "CLI_ARGS", env_value: "\"--gameid minetest\"", desc: "Optionally specify any [CLI variables](https://wiki.minetest.net/Command_line) you want to launch the app with" } + - { env_var: "CLI_ARGS", env_value: "\"--gameid minetest --port 30000\"", desc: "Optionally specify any [CLI variables](https://wiki.minetest.net/Command_line) you want to launch the app with" } # application setup block @@ -44,12 +44,18 @@ app_setup_block_enabled: true app_setup_block: | You can find the world maps, mods folder and config files in /config/.minetest. + If you want to override the advertised port, ensure you add --port in your CLI_ARGS AND ensure the internal port reflects the change, ie; + if you set your advertised port to 40000 with --port 40000 then your ports declaration should be 40000:40000/udp + + Client and server must be the same version, please browse the tags here to pull the appropriate version for your server: https://hub.docker.com/r/linuxserver/{{ project_name }}/tags # changelog changelogs: - - { date: "19.01.21:", desc: "Rebasing to alpine 3.15." } + - { date: "02.05.22:", desc: "Allow specifying the advertised port."} + - { date: "17.03.22:", desc: "Install forked irrlicht, add zstd." } + - { date: "19.01.22:", desc: "Rebasing to alpine 3.15." } - { date: "02.06.20:", desc: "Rebasing to alpine 3.12." } - { date: "19.12.19:", desc: "Rebasing to alpine 3.11." } - { date: "12.07.19:", desc: "Bugfix to support multiple CLI variables." } diff --git a/root/etc/services.d/minetest/run b/root/etc/services.d/minetest/run index b842bc6..8845bd8 100644 --- a/root/etc/services.d/minetest/run +++ b/root/etc/services.d/minetest/run @@ -1,5 +1,5 @@ #!/usr/bin/with-contenv bash exec \ - s6-setuidgid abc minetestserver ${CLI_ARGS} \ - --config /config/.minetest/main-config/minetest.conf --port 30000 + s6-setuidgid abc minetestserver --port 30000 \ + --config /config/.minetest/main-config/minetest.conf ${CLI_ARGS}