Add Cleanroom server type (#4300)

This commit is contained in:
Lilith authored and GitHub committed 2026-10-13 11:01:09 -05:00
1 parent 11b8d5b219
commit 7934d32399
4 files changed
+146 -7

No files matched your search

@@ -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 specifically for Minecraft 1.12.2, so `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.7.0".
!!! example
```shell
docker run -e TYPE=CLEANROOM -e CLEANROOM_LOADER_VERSION=0.7.0 ...
```
or in a compose file
```yaml
environment:
TYPE: CLEANROOM
CLEANROOM_LOADER_VERSION: "0.7.0"
```
By default, the latest version of the installer will be selected. You can instead choose a specific installer version by setting `CLEANROOM_INSTALLER_VERSION`, such as "0.2.0".
!!! example
```shell
docker run -e TYPE=CLEANROOM -e CLEANROOM_INSTALLER_VERSION=0.2.0 ...
```
or in a compose file
```yaml
environment:
TYPE: CLEANROOM
CLEANROOM_INSTALLER_VERSION: "0.2.0"
```
!!! 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
A legacy installer is supported as-is, but issues will not be addressed.
!!! note
If an error occurs 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
+23 -6
View File
@@ -3,13 +3,30 @@
services: services:
mc: mc:
image: itzg/minecraft-server 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: ports:
# expose the Minecraft server port outside of container
- "25565:25565" - "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: 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: volumes:
mc-data: # declared the named volume, but use default/local storage engine
mc-data: {}
+6 -1
View File
@@ -283,6 +283,10 @@ case "${TYPE^^}" in
exec "$(dirname "$0")/start-deployForge" "$@" exec "$(dirname "$0")/start-deployForge" "$@"
;; ;;
CLEANROOM)
exec "$(dirname "$0")/start-deployCleanroom" "$@"
;;
NEOFORGE|NEOFORGED) NEOFORGE|NEOFORGED)
exec "$(dirname "$0")/start-deployNeoForge" "$@" exec "$(dirname "$0")/start-deployNeoForge" "$@"
;; ;;
@@ -367,7 +371,8 @@ case "${TYPE^^}" in
logError "Invalid TYPE: '$TYPE'" logError "Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT," logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH," logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, NANOLIMBO, PUMPKIN, CRUCIBLE, LEAF, YOUER, BANNER, NEOFORGE" logError " CANYON, LIMBO, NANOLIMBO, PUMPKIN, CRUCIBLE, LEAF, YOUER, BANNER, NEOFORGE,"
logError " CLEANROOM"
exit 1 exit 1
;; ;;
+50
View File
@@ -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" "$@"