Skip to content
Open
67 changes: 67 additions & 0 deletions docs/types-and-platforms/server-types/cleanroom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
A [Cleanroom server](https://cleanroommc.com/) can be automatically downloaded, upgraded, and run by setting the environment variable `TYPE` to "CLEANROOM".

!!! example

```shell
docker run -e TYPE=CLEANROOM ...
```

or in a compose file
```yaml
environment:
TYPE: CLEANROOM
```

Cleanroom is a loader specified for Minecraft 1.12.2, since then `VERSION` will be ignored. By default, the latest version of Cleanroom will be selected. You can also choose a specific Cleanroom version by setting `CLEANROOM_LOADER_VERSION` with that version, such as "0.6.13-alpha".

!!! example

```shell
docker run -e TYPE=CLEANROOM -e CLEANROOM_LOADER_VERSION=0.6.13-alpha ...
```

or in a compose file
```yaml
environment:
TYPE: CLEANROOM
CLEANROOM_LOADER_VERSION: "0.6.13-alpha"
```

You can also specify installer version. By default, the latest version of installer will be selected. You can also choose a specific installer version by setting `CLEANROOM_INSTALLER_VERSION` with that version, such as "0.1.4".

!!! example

```shell
docker run -e TYPE=CLEANROOM -e CLEANROOM_INSTALLER_VERSION=0.1.4 ...
```

or in a compose file
```yaml
environment:
TYPE: CLEANROOM
CLEANROOM_INSTALLER_VERSION: "0.1.4"
```

!!! note

You do not need to setup this unless required. The installer come from Cleanroom support multi-version installation compare to legacy installer.

To use a pre-downloaded Cleanroom installer, place it in a location mounted into the container and specify the container path with `CLEANROOM_FROM_FILE`. To download a Cleanroom installer from a custom location, such as your own file repository, specify the URL with `CLEANROOM_FROM_URL`.

In both of the cases above, there is no need for the `CLEANROOM_LOADER_VERSION` or `CLEANROOM_INSTALLER_VERSION` variables.

!!! note

By default, legacy installer are supported but limited support will be provided if asked.

!!! note

If an error occurred while installing Cleanroom, it might be possible to resolve by temporarily setting `CLEANROOM_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.

Specified installer version is configurable via environment variables:

- `CLEANROOM_INSTALLER_VERSION`: used to specific installer version, default is latest

URLs configurable via environment variables:

- `CLEANROOM_MAVEN_URL`: default is https://maven.cleanroommc.com
29 changes: 23 additions & 6 deletions examples/cleanroom/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,30 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: FORGE
FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar
ports:
# expose the Minecraft server port outside of container
- "25565:25565"
environment:
# REQUIRED for all types
EULA: "TRUE"

# Set server type (vs the default of vanilla)
TYPE: CLEANROOM
DEBUG: "true"

# Optional (check doc for usage)
# CLEANROOM_LOADER_VERSION: 0.0.0-alpha
# CLEANROOM_INSTALLER_VERSION: 0.1.4
# Using either follow env will ignore 2 above
# CLEANROOM_FROM_LOCAL: ./installer.jar
# CLEANROOM_FROM_URL: https://
volumes:
- mc-data:/data
# use a named, managed volume for data volume
- mc_data:/data
# attach local host directory "mods" in same directory as this compose file
# all mods in this directory get copied into /data/mods at startup
- ./mods:/mods:ro

volumes:
mc-data:
# declared the named volume, but use default/local storage engine
mc-data: {}
7 changes: 6 additions & 1 deletion scripts/start-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ case "${TYPE^^}" in
exec "$(dirname "$0")/start-deployForge" "$@"
;;

CLEANROOM)
exec "$(dirname "$0")/start-deployCleanroom" "$@"
;;

NEOFORGE|NEOFORGED)
exec "$(dirname "$0")/start-deployNeoForge" "$@"
;;
Expand Down Expand Up @@ -363,7 +367,8 @@ case "${TYPE^^}" in
logError "Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER, NEOFORGE"
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER, NEOFORGE,"
logError " CLEANROOM"
exit 1
;;

Expand Down
50 changes: 50 additions & 0 deletions scripts/start-deployCleanroom
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

: "${CLEANROOM_FORCE_REINSTALL:=false}"

# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
isDebugging && set -x
resultsFile=/data/.run-cleanroom.env

declare -a cleanroom_installer_options
cleanroom_installer_options+=(--output-directory=/data)
cleanroom_installer_options+=(--results-file="${resultsFile}")
cleanroom_installer_options+=(--force-reinstall="${CLEANROOM_FORCE_REINSTALL}")

if [[ ${CLEANROOM_LOADER_VERSION} ]]; then
cleanroom_installer_options+=(--loader-version="${CLEANROOM_LOADER_VERSION}")
fi

if [[ ${CLEANROOM_INSTALLER_VERSION} ]]; then
cleanroom_installer_options+=(--installer-version="${CLEANROOM_INSTALLER_VERSION}")
fi

if [[ ${CLEANROOM_FROM_FILE} ]]; then
cleanroom_installer_options+=(--from-local-file="${CLEANROOM_FROM_FILE}")
fi

if [[ ${CLEANROOM_FROM_URL} ]]; then
cleanroom_installer_options+=(--from-url="${CLEANROOM_FROM_URL}")
fi

if [[ ${CLEANROOM_MAVEN_URL} ]]; then
cleanroom_installer_options+=(--cleanroom-maven-url="${CLEANROOM_MAVEN_URL}")
fi

if ! mc-image-helper install-cleanroom "${cleanroom_installer_options[@]}" ; then
if [[ ${CLEANROOM_FROM_FILE} ]]; then
logError "Failed to install Cleanroom given installer ${CLEANROOM_FROM_FILE}"
elif [[ ${CLEANROOM_FROM_URL:-} ]]; then
logError "Failed to install Cleanroom from ${CLEANROOM_FROM_URL}"
else
logError "Failed to install Cleanroom"
fi
exit 1
fi

applyResultsFile ${resultsFile}

export FAMILY=FORGE

exec "$(dirname "$0")/start-setupWorld" "$@"