mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-16 23:23:06 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
commit
2086562d03
4 changed files with 67 additions and 65 deletions
18
README.md
18
README.md
|
@ -145,7 +145,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
||||||
* [Enabling Autopause](#enabling-autopause)
|
* [Enabling Autopause](#enabling-autopause)
|
||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Sun Jul 4 19:53:56 UTC 2021 -->
|
<!-- Added by: runner, at: Tue Jul 13 00:03:33 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
|
@ -450,9 +450,7 @@ An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of T
|
||||||
|
|
||||||
-e TYPE=AIRPLANE
|
-e TYPE=AIRPLANE
|
||||||
|
|
||||||
> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.16" "1.17" and "PURPUR"
|
> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.17" "1.16" "PURPUR" and "PURPUR-1.16"
|
||||||
|
|
||||||
> NOTE: The 1.17 branch is currently in beta, and is not yet sufficiently stable for production use. Use at your own risk!
|
|
||||||
|
|
||||||
Extra variables:
|
Extra variables:
|
||||||
- `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use
|
- `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use
|
||||||
|
@ -1214,13 +1212,19 @@ For some cases, if e.g. after removing mods, it could be necessary to startup mi
|
||||||
|
|
||||||
### Interactive and Color Console
|
### Interactive and Color Console
|
||||||
|
|
||||||
If you would like to attach to the Minecraft server console with color and interactive capabilities, then add
|
If you would like to `docker attach` to the Minecraft server console with color and interactive capabilities, then add
|
||||||
|
|
||||||
```
|
```
|
||||||
-e EXEC_DIRECTLY=true
|
-e EXEC_DIRECTLY=true
|
||||||
```
|
```
|
||||||
|
|
||||||
> **NOTE** this will bypass graceful server shutdown handling when using `docker stop`, so be sure to use `rcon-cli` or console commands to `stop` the server.
|
> **NOTES**
|
||||||
|
>
|
||||||
|
> This feature doesn't work via rcon, so you will need to `docker attach` to the container. Use the sequence Ctrl-P, Ctrl-Q to detach.
|
||||||
|
>
|
||||||
|
> This will bypass graceful server shutdown handling when using `docker stop`, so be sure the server console's `stop` command.
|
||||||
|
>
|
||||||
|
> Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose.
|
||||||
|
|
||||||
### OpenJ9 Specific Options
|
### OpenJ9 Specific Options
|
||||||
|
|
||||||
|
@ -1312,7 +1316,7 @@ Of course, even loaded chunks are not ticked when the process is stopped.
|
||||||
|
|
||||||
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](#max-tick-time).
|
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](#max-tick-time).
|
||||||
|
|
||||||
> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately (e.g. PAPER Servers).
|
> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately. For PaperMC servers, you need to send the JVM flag `-Ddisable.watchdog=true`, this can be done with the docker env variable `-e JVM_DD_OPTS=disable.watchdog:true`
|
||||||
|
|
||||||
On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled.
|
On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled.
|
||||||
|
|
||||||
|
|
15
examples/docker-compose-fabric.yml
Normal file
15
examples/docker-compose-fabric.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: ${IMAGE:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
TYPE: FABRIC
|
||||||
|
ports:
|
||||||
|
- 25565:25565
|
||||||
|
volumes:
|
||||||
|
- fabric:/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
fabric: {}
|
|
@ -5,28 +5,26 @@ IFS=$'\n\t'
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ]; then
|
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
|
||||||
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.16, VERSION=1.17 or VERSION=PURPUR. Note that these are branches, not #.#.# versions."
|
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
||||||
|
|
||||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.16" ]; then
|
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
||||||
|
AIRPLANE_BRANCH="1.17"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" = "1.16" ]; then
|
||||||
AIRPLANE_BRANCH="1.16"
|
AIRPLANE_BRANCH="1.16"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${VERSION}" = "1.17" ]; then
|
|
||||||
AIRPLANE_BRANCH="1.17"
|
|
||||||
log "AIRPLANE 1.17 IS IN BETA, AND IS NOT YET PRODUCTION-READY. USE AT YOUR OWN RISK!!!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "1.17.1" ]; then
|
|
||||||
AIRPLANE_BRANCH="1.17.1"
|
|
||||||
log "AIRPLANE 1.17.1 IS IN BETA, AND IS NOT YET PRODUCTION-READY. USE AT YOUR OWN RISK!!!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "PURPUR" ]; then
|
if [ "${VERSION}" = "PURPUR" ]; then
|
||||||
|
AIRPLANE_BRANCH="Purpur-1.17"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" = "PURPUR-1.16" ]; then
|
||||||
AIRPLANE_BRANCH="Purpur-1.16"
|
AIRPLANE_BRANCH="Purpur-1.16"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -3,54 +3,43 @@ set -eu
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
|
requireVar VANILLA_VERSION
|
||||||
export TYPE=FABRIC
|
export TYPE=FABRIC
|
||||||
|
export SERVER=fabric-server-${VANILLA_VERSION}.jar
|
||||||
|
|
||||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
isDebugging && set -x
|
||||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
|
||||||
FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}}
|
if [[ ! -e ${SERVER} ]]; then
|
||||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
|
||||||
|
: ${FABRIC_INSTALLER:=}
|
||||||
|
: ${FABRIC_INSTALLER_URL:=}
|
||||||
|
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
||||||
|
|
||||||
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
log "Checking Fabric version information."
|
log "Checking Fabric version information."
|
||||||
case $FABRIC_INSTALLER_VERSION in
|
if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
||||||
LATEST)
|
|
||||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
markerVersion=$FABRIC_INSTALLER_VERSION
|
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
|
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
FABRIC_INSTALLER="fabric-installer.jar"
|
||||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
markerVersion=custom
|
|
||||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
|
||||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}"
|
|
||||||
|
|
||||||
debug Checking for installMarker ${installMarker}
|
|
||||||
if [[ ! -e $installMarker ]]; then
|
|
||||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
|
||||||
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
|
|
||||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
|
||||||
log "...trying $downloadUrl"
|
|
||||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
|
||||||
else
|
|
||||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if isDebugging; then
|
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||||
debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
|
||||||
else
|
|
||||||
log "Installing Fabric using $FABRIC_INSTALLER"
|
|
||||||
fi
|
|
||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
|
@ -67,13 +56,9 @@ if [[ ! -e $installMarker ]]; then
|
||||||
log "Fabric failed to install after several tries." >&2
|
log "Fabric failed to install after several tries." >&2
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
export SERVER=fabric-server-launch.jar
|
|
||||||
log "Using server $SERVER"
|
|
||||||
echo $SERVER > $installMarker
|
|
||||||
|
|
||||||
else
|
mv fabric-server-launch.jar ${SERVER}
|
||||||
export SERVER=$(< $installMarker)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Contineut to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
|
|
Loading…
Reference in a new issue