Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,33 @@ docker run -d -v /path/on/host:/data ... \

See the [Working with mods and plugins](#working-with-mods-and-plugins) section to set up Fabric mods and configuration.

### Running a Quilt Server

Enable [Quilt server](https://quiltmc.org/) mode by adding a `-e TYPE=QUILT` to your command-line.

```
docker run -d -v /path/on/host:/data \
-e TYPE=QUILT \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```

By default, the container will install the latest [quilt server launcher](https://quiltmc.org/install/server/), using the latest [quilt-installer](https://github.com/QuiltMC/quilt-installer) against the minecraft version you have defined with `VERSION` (defaulting to the latest vanilla release of the game).

A specific loader or installer version other than the latest can be requested using `QUILT_LOADER_VERSION` and `QUILT_INSTALLER_VERSION` respectively, such as:

```
docker run -d -v /path/on/host:/data ... \
-e TYPE=QUILT \
-e QUILT_LOADER_VERSION=0.16.0 \
-e QUILT_INSTALLER_VERSION=0.4.1
```

> If you wish to use an alternative launcher you can:
> * Provide the path to a custom launcher jar available to the container with `QUILT_LAUNCHER`, relative to `/data` (such as `-e QUILT_LAUNCHER=quilt-server-custom.jar`)
> * Provide the URL to a custom launcher jar with `QUILT_LAUNCHER_URL` (such as `-e QUILT_LAUNCHER_URL=http://HOST/quilt-server-custom.jar`)

See the [Working with mods and plugins](#working-with-mods-and-plugins) section to set up Quilt mods and configuration.

### Running a Bukkit/Spigot server

Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
Expand Down
4 changes: 4 additions & 0 deletions scripts/start-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ case "${TYPE^^}" in
exec "${SCRIPTS:-/}start-deployFabric" "$@"
;;

QUILT)
exec "${SCRIPTS:-/}start-deployQuilt" "$@"
;;

FTBA)
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployFTBA" "$@"
Expand Down
60 changes: 60 additions & 0 deletions scripts/start-deployQuilt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
set -eu

# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"

requireVar VANILLA_VERSION
export TYPE=QUILT
: "${QUILT_LAUNCHER:=}"
: "${QUILT_LAUNCHER_URL:=}"
: "${QUILT_INSTALLER_URL:=}"
: "${QUILT_INSTALLER_VERSION:=LATEST}"
: "${QUILT_LOADER_VERSION:=LATEST}"

isDebugging && set -x

# Custom quilt jar
if [[ $QUILT_LAUNCHER ]]; then
export SERVER=${QUILT_LAUNCHER}
# Custom quilt jar url
elif [[ $QUILT_LAUNCHER_URL ]]; then
export SERVER=quilt-server-$(echo -n "$QUILT_LAUNCHER_URL" | mc-image-helper hash)
# Official quilt installer
else
if [[ ${QUILT_INSTALLER_VERSION^^} = LATEST ]]; then
log "Checking Quilt Installer version information."
QUILT_INSTALLER_VERSION=$(maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/maven-metadata.xml)
fi
if [[ ${QUILT_LOADER_VERSION^^} = LATEST ]]; then
log "Checking Quilt Loader version information."
QUILT_LOADER_VERSION=$(maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-loader/maven-metadata.xml)
fi
export INSTALLER=quilt-installer-${QUILT_INSTALLER_VERSION}.jar
export SERVER=quilt-server-${VANILLA_VERSION}-${QUILT_LOADER_VERSION}-launch.jar
export QUILT_INSTALLER_URL="https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/${QUILT_INSTALLER_VERSION}/quilt-installer-${QUILT_INSTALLER_VERSION}.jar"
fi

if [[ ! -e ${SERVER} && ! -z ${QUILT_INSTALLER_URL} ]]; then
log "Downloading and installing $QUILT_INSTALLER_URL ..."
if ! get -o "$INSTALLER" "$QUILT_INSTALLER_URL"; then
log "Failed to download from given location $QUILT_INSTALLER_URL"
exit 2
fi
if ! java -jar ${INSTALLER} install server ${VANILLA_VERSION} ${QUILT_LOADER_VERSION} --install-dir=./ --download-server; then
log "Failed to install $INSTALLER"
exit 2
fi
if ! mv quilt-server-launch.jar ${SERVER}; then
log "Failed to rename $SERVER"
exit 2
fi
fi

if [[ ! -e ${SERVER} ]]; then
log "$SERVER does not exist, cannot launch server!"
exit 1
fi

export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"
13 changes: 13 additions & 0 deletions tests/setuponlytests/quilt/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"

services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
TYPE: QUILT
VERSION: ${MINECRAFT_VERSION:-LATEST}
volumes:
- ./data:/data
1 change: 1 addition & 0 deletions tests/setuponlytests/quilt/require.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[ $MINECRAFT_VERSION == LATEST ]] || exit 1
1 change: 1 addition & 0 deletions tests/setuponlytests/quilt/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mc-image-helper assert fileExists "/data/quilt-server-*-launch.jar"