diff --git a/Dockerfile b/Dockerfile index fabe2ec5..086bb7cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ - --var version=1.5.0 --var app=mc-server-runner --file {{.app}} \ + --var version=1.6.0 --var app=mc-server-runner --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ diff --git a/README.md b/README.md index 3bc32b56..ae812249 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Memory Limit](#memory-limit) * [JVM Options](#jvm-options) * [Interactive and Color Console](#interactive-and-color-console) + * [Server Shutdown Options](#server-shutdown-options) * [OpenJ9 Specific Options](#openj9-specific-options) * [Enabling rolling logs](#enabling-rolling-logs) * [Timezone Configuration](#timezone-configuration) @@ -126,7 +127,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + @@ -1210,6 +1211,12 @@ If you would like to `docker attach` to the Minecraft server console with color > > Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose. +### Server Shutdown Options + +To allow time for players to finish what they're doing during a graceful server shutdown, set `STOP_SERVER_ANNOUNCE_DELAY` to a number of seconds to delay after an announcement is posted by the server. + +> **NOTE** be sure to adjust Docker's shutdown timeout accordingly, such as using [the -t option on docker-compose down](https://docs.docker.com/compose/reference/down/). + ### OpenJ9 Specific Options The openj9 image tags include specific variables to simplify configuration: diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index cf83c815..5359fe7f 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -173,6 +173,10 @@ function copyFilesForCurseForge() { } mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s" +if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then + mcServerRunnerArgs="${mcServerRunnerArgs} --stop-server-announce-delay ${STOP_SERVER_ANNOUNCE_DELAY}s" +fi + if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then if isTrue ${DEBUG_EXEC}; then set -x