Disable healthcheck for unsupported versions (#2360)

This commit is contained in:
DanielN 2023-08-27 16:41:42 +02:00 committed by GitHub
parent 03034d2f15
commit bb57d7e99f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 3 deletions

View file

@ -42,7 +42,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.34.6
ARG MC_HELPER_VERSION=1.34.7
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1

View file

@ -25,3 +25,8 @@ healthcheck:
```
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
### Healthchecks for older versions
This container disables Healthchecks for Versions before b1.8 as those versions do not support any kind of server pinging.
For more information see [Server List Ping](https://wiki.vg/Server_List_Ping#Beta_1.8_to_1.3)

View file

@ -2,7 +2,8 @@ To use a different Minecraft version, pass the `VERSION` environment variable (c
- LATEST (the default)
- SNAPSHOT
- or a specific version, such as "1.7.9"
- a specific version, such as "1.7.9"
- or an alpha and beta version, such as "b1.7.3" (server download might not exist)
For example, to use the latest snapshot:

View file

@ -221,7 +221,11 @@ function copyFilesForCurseForge() {
cp -f /data/eula.txt "${FTB_DIR}/"
}
if versionLessThan 1.7; then
if versionLessThan 'b1.8'; then
echo "
DISABLE_HEALTHCHECK=true
" > /data/.mc-health.env
elif versionLessThan 1.7; then
echo "
MC_HEALTH_EXTRA_ARGS=(
--use-server-list-ping