Skip to content

Commit 7cdb7d3

Browse files
authored
Add support for Cleanroom (Forge fork) installer (#3291)
1 parent 26d97c2 commit 7cdb7d3

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
5050
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
5151
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
5252

53-
ARG MC_HELPER_VERSION=1.40.11
53+
ARG MC_HELPER_VERSION=1.40.12
5454
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
5555
# used for cache busting local copy of mc-image-helper
5656
ARG MC_HELPER_REV=1

docs/types-and-platforms/server-types/forge.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded, upgraded, and run by setting the environment variable `TYPE` to "FORGE".
22

3+
!!! note "A note from the installer"
4+
5+
> Please do not automate the download and installation of Forge.
6+
Our efforts are supported by ads from the download page.
7+
If you MUST automate this, please consider supporting the project through <https://www.patreon.com/LexManos/>
8+
9+
Since my project also relies on donations, please pass it along and consider contributing to the Patreon above.
10+
311
!!! example
412

513
```
@@ -14,6 +22,7 @@ A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded
1422

1523
The overall version is specified by `VERSION`, [as described in the section above](../../versions/minecraft.md) and provides the same benefits of upgrading as new versions are released. By default, the recommended version of Forge for that Minecraft version will be selected. The latest version can be selected instead by setting the environment variable `FORGE_VERSION` to "latest". You can also choose a specific Forge version by setting `FORGE_VERSION` with that version, such as "14.23.5.2854".
1624

25+
1726
!!! example
1827

1928
```
@@ -55,3 +64,22 @@ Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge serv
5564
VERSION: "1.20.4"
5665
NEOFORGE_VERSION: "beta"
5766
```
67+
68+
### Cleanroom
69+
70+
[Cleanroom](https://github.com/CleanroomMC/Cleanroom) isn't fully automated, but can be utilized by...
71+
72+
1. choose the desired release at https://github.com/CleanroomMC/Cleanroom/releases
73+
2. grab the link to the `*-installer.jar` file in that release
74+
3. with `TYPE` set to "FORGE", set `FORGE_INSTALLER_URL` to the installer jar's link
75+
76+
!!! example
77+
78+
In docker compose `environment`
79+
80+
```yaml
81+
TYPE: FORGE
82+
FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar
83+
```
84+
85+
[Full example](https://github.com/itzg/docker-minecraft-server/tree/master/examples/cleanroom)

examples/cleanroom/compose.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Provides an example of running CleanroomMC from https://github.com/CleanroomMC/Cleanroom,
2+
# which is a Forge fork
3+
services:
4+
mc:
5+
image: itzg/minecraft-server
6+
environment:
7+
EULA: true
8+
TYPE: FORGE
9+
FORGE_INSTALLER_URL: https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar
10+
ports:
11+
- "25565:25565"
12+
volumes:
13+
- mc-data:/data
14+
volumes:
15+
mc-data:

scripts/start-deployForge

+14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ if [[ ${FORGE_INSTALLER} ]]; then
2121
logError "Failed to installForge given installer ${FORGE_INSTALLER}"
2222
exit 1
2323
fi
24+
elif [[ ${FORGE_INSTALLER_URL:-} ]]; then
25+
mkdir -p tmp
26+
if ! installer=$(get -o tmp --output-filename "${FORGE_INSTALLER_URL}"); then
27+
logError "Failed to download installer from $FORGE_INSTALLER_URL"
28+
exit 1
29+
fi
30+
31+
# shellcheck disable=SC2064
32+
trap "rm $installer" EXIT
33+
34+
if ! mc-image-helper-forge --forge-installer="${installer}" ; then
35+
logError "Failed to install forge from ${FORGE_INSTALLER_URL}"
36+
exit 1
37+
fi
2438
else
2539
if ! mc-image-helper-forge --forge-version="${FORGE_VERSION}"; then
2640
logError "Failed to install Forge"

0 commit comments

Comments
 (0)