mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-16 08:37:12 +00:00
Provide option to apply Cleanroom to any Forge-like server type (#4338)
This commit is contained in:
1 parent
9693e382f3
commit
d8cd6f3f38
5 files changed
+81
-48
No files matched your search
@@ -87,4 +87,24 @@ Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge serv
|
|||||||
FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar
|
FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
[Full example](https://github.com/itzg/docker-minecraft-server/tree/master/examples/cleanroom)
|
[Full example](https://github.com/itzg/docker-minecraft-server/tree/master/examples/cleanroom)
|
||||||
|
|
||||||
|
#### Apply Cleanroom
|
||||||
|
|
||||||
|
As an alternative to replacing the `TYPE` as "cleanroom", you can use any of the Forge-like types above, including `AUTO_CURSEFORGE` described [here](../mod-platforms/auto-curseforge.md), and apply Cleanroom as the loader by setting the environment variable `APPLY_CLEANROOM` to "true".
|
||||||
|
|
||||||
|
All the configuration options described above can be used with this.
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
|
||||||
|
As mentioned above, Cleanroom **only works with 1.12.2**, so be sure to utilize modpacks and mods that are compatible with 1.12.2. If using a `TYPE` of "forge" or "neoforge", be sure to set `VERSION` to "1.12.2".
|
||||||
|
|
||||||
|
!!! example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
EULA: true
|
||||||
|
TYPE: AUTO_CURSEFORGE
|
||||||
|
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/enigmatica2expert/files/9088147
|
||||||
|
APPLY_CLEANROOM: true
|
||||||
|
```
|
||||||
@@ -22,7 +22,7 @@ services:
|
|||||||
# CLEANROOM_FROM_URL: https://
|
# CLEANROOM_FROM_URL: https://
|
||||||
volumes:
|
volumes:
|
||||||
# use a named, managed volume for data volume
|
# use a named, managed volume for data volume
|
||||||
- mc_data:/data
|
- mc-data:/data
|
||||||
# attach local host directory "mods" in same directory as this compose file
|
# attach local host directory "mods" in same directory as this compose file
|
||||||
# all mods in this directory get copied into /data/mods at startup
|
# all mods in this directory get copied into /data/mods at startup
|
||||||
- ./mods:/mods:ro
|
- ./mods:/mods:ro
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
#!/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
|
||||||
@@ -1,50 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
: "${CLEANROOM_FORCE_REINSTALL:=false}"
|
# run within the current shell to retain exported environment variables
|
||||||
|
. "$(dirname "$0")/start-applyCleanroom"
|
||||||
# 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" "$@"
|
exec "$(dirname "$0")/start-setupWorld" "$@"
|
||||||
@@ -409,4 +409,13 @@ case "X$MODCONFIG" in
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if isTrue "${APPLY_CLEANROOM}"; then
|
||||||
|
if [[ "$VERSION" != "1.12.2" ]]; then
|
||||||
|
logError "Cleanroom only works with Minecraft version 1.12.2. Current version is $VERSION."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# run within the current shell to retain exported environment variables
|
||||||
|
. "$(dirname "$0")/start-applyCleanroom"
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$(dirname "$0")/start-setupMounts" "$@"
|
exec "$(dirname "$0")/start-setupMounts" "$@"
|
||||||
Reference in new issue
Block a user