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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

ARG MC_HELPER_VERSION=1.40.11
ARG MC_HELPER_VERSION=1.40.12
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1
Expand Down
28 changes: 28 additions & 0 deletions docs/types-and-platforms/server-types/forge.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded, upgraded, and run by setting the environment variable `TYPE` to "FORGE".

!!! note "A note from the installer"

> Please do not automate the download and installation of Forge.
Our efforts are supported by ads from the download page.
If you MUST automate this, please consider supporting the project through <https://www.patreon.com/LexManos/>

Since my project also relies on donations, please pass it along and consider contributing to the Patreon above.

!!! example

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

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".


!!! example

```
Expand Down Expand Up @@ -55,3 +64,22 @@ Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge serv
VERSION: "1.20.4"
NEOFORGE_VERSION: "beta"
```

### Cleanroom

[Cleanroom](https://github.com/CleanroomMC/Cleanroom) isn't fully automated, but can be utilized by...

1. choose the desired release at https://github.com/CleanroomMC/Cleanroom/releases
2. grab the link to the `*-installer.jar` file in that release
3. with `TYPE` set to "FORGE", set `FORGE_INSTALLER_URL` to the installer jar's link

!!! example

In docker compose `environment`

```yaml
TYPE: FORGE
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)
15 changes: 15 additions & 0 deletions examples/cleanroom/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Provides an example of running CleanroomMC from https://github.com/CleanroomMC/Cleanroom,
# which is a Forge fork
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:
- "25565:25565"
volumes:
- mc-data:/data
volumes:
mc-data:
14 changes: 14 additions & 0 deletions scripts/start-deployForge
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ if [[ ${FORGE_INSTALLER} ]]; then
logError "Failed to installForge given installer ${FORGE_INSTALLER}"
exit 1
fi
elif [[ ${FORGE_INSTALLER_URL:-} ]]; then
mkdir -p tmp
if ! installer=$(get -o tmp --output-filename "${FORGE_INSTALLER_URL}"); then
logError "Failed to download installer from $FORGE_INSTALLER_URL"
exit 1
fi

# shellcheck disable=SC2064
trap "rm $installer" EXIT

if ! mc-image-helper-forge --forge-installer="${installer}" ; then
logError "Failed to install forge from ${FORGE_INSTALLER_URL}"
exit 1
fi
else
if ! mc-image-helper-forge --forge-version="${FORGE_VERSION}"; then
logError "Failed to install Forge"
Expand Down