Compare commits

...

47 Commits

Author SHA1 Message Date
Geoff Bourne
55bc4fd329 Use PAT for auto releaser runs (#3801) 2025-12-13 10:25:29 -06:00
Aki
d7d3cc50a0 Do not overwrite existing NanoLimbo settings.yml (#3799) 2025-12-12 20:16:08 -06:00
Geoff Bourne
d1535c1eeb Add auto-release workflow configuration (#3800) 2025-12-11 20:57:33 -06:00
EmilyxFox
aadf1a8b9f Bump mc-server-runner & document websocket API (#3789) 2025-12-09 21:46:12 -06:00
EmilyxFox
cdbcf41bfc update docs copyright notice year (#3794) 2025-12-09 21:23:14 -06:00
JackHicks02
548bea7786 Add CF_EXCLUDE_ALL_MODS (#3793) 2025-12-09 20:05:15 -06:00
Geoff Bourne
06836b941a gtnh: support grabbing extra mods (#3788) 2025-12-06 17:18:19 -06:00
dependabot[bot]
53fcaabdf7 build(deps): bump docker/metadata-action from 5.9.0 to 5.10.0 in the updates group (#3784) 2025-12-01 07:25:15 -06:00
dependabot[bot]
7922797744 build(deps): bump actions/checkout from 5.0.0 to 6.0.0 (#3771) 2025-11-25 17:52:15 -08:00
Geoff Bourne
afaa4c89a1 Adding inline example of USES_PLUGINS with Cardboard (#3779) 2025-11-25 18:35:04 -06:00
Geoff Bourne
43a7e9a36c Add java25-jdk image variant (#3778) 2025-11-25 18:20:08 -06:00
dependabot[bot]
ac46484072 build(deps): bump mkdocs-material from 9.6.23 to 9.7.0 in /docs in the patches group (#3772) 2025-11-25 15:16:38 -08:00
Sam Horton
c26119b512 Allow custom modloader versions for auto curseforge (#3759) 2025-11-23 11:15:39 -08:00
Geoff Bourne
85673fb661 Exclude cull-less-leaves and mining-speed-tooltips (#3766) 2025-11-16 20:09:54 -06:00
Geoff Bourne
fae779998a Exclude Netty http3 to ensure Alpine musl support (#3765) 2025-11-15 11:54:40 -06:00
Alejandro González
a29bb020d9 fix(graalvm): update to Oracle Linux 10 to fix file command mimetype issues (#3764) 2025-11-15 10:41:17 -06:00
Alejandro González
0e3c655d27 fix(tests): ensure Nginx is fully spun up before starting MC container (#3763) 2025-11-15 07:47:03 -06:00
Alejandro González
2d1e96f5ba fix(graalvm): update to Oracle Linux 9 to fix glibc compat issues (#3761) 2025-11-14 19:36:09 -06:00
k4rnaj1k
11daad5dd3 Add support for health check for pre-1.3 versions (#3758) 2025-11-12 15:24:01 -06:00
Geoff Bourne
6cdc1a4b78 deps: upgrade tools to Go 1.25.3 (#3741) 2025-11-12 14:35:07 -06:00
Geoff Bourne
5983aea0b9 forge and neoforge: skip lookup if exact request matches installed version (#3756) 2025-11-11 12:27:14 -06:00
dependabot[bot]
36d278677e build(deps): bump the updates group with 2 updates (#3755) 2025-11-10 05:59:07 -06:00
Leon Kampwerth
d974c1ec52 Removed catserver and updated magma download (#3751)
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2025-11-08 10:26:02 -06:00
Kim
c7eb26515c Add 'status-effect-bars-reforged' to global excludes (#3752) 2025-11-07 19:27:41 -06:00
Kim
baf55337c5 forceIncludes particular-reforged for ftb-stoneblock-4 (#3753) 2025-11-06 20:51:39 -06:00
Leon Kampwerth
3941bd4e41 Support jvm mem percentage (#3747) 2025-11-06 06:37:23 -06:00
Geoff Bourne
eeb62d45f9 Corrected the examples for JVM_OPTS (#3746) 2025-11-05 14:33:45 -06:00
Geoff Bourne
a8d8bfeef8 Corrected version comparison to determine mc-health mode to use pre-1.7 (#3745) 2025-11-05 12:23:19 -06:00
JackHicks02
690745cb13 File globbing for Ignore Missing Files (#3744) 2025-11-03 17:09:17 -06:00
dependabot[bot]
6d38d24f3c build(deps): bump mkdocs-material from 9.6.22 to 9.6.23 in /docs in the patches group (#3742) 2025-11-03 06:21:03 -06:00
Geoff Bourne
6a8bcffa17 Updated example snippets for CF_PAGE_URL and CF_SLUG (#3740) 2025-11-01 22:30:27 -05:00
EmilyxFox
3f910f6910 Add pull policy to examples in docs (#3739) 2025-11-01 10:33:20 -05:00
Geoff Bourne
da72d66774 auto-cf: fix issue with unknown FileStatus values (#3736) 2025-10-31 06:20:48 -05:00
Leon Kampwerth
f62ad37d31 Integrate gtnh mod (#3727)
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2025-10-30 21:21:22 -05:00
Geoff Bourne
d56efcd680 paper: pick max build and not assume first is newest (#3728) 2025-10-25 23:01:56 -05:00
dependabot[bot]
35a94a9b18 build(deps): bump mkdocs-material from 9.6.21 to 9.6.22 in /docs in the patches group (#3724) 2025-10-21 08:34:33 -05:00
Geoff Bourne
58623e308d Document that MODRINTH_PROJECTS version ID can override game/loader check (#3721) 2025-10-19 20:10:53 -05:00
Geoff Bourne
2cd7472631 Documented the loader prefix option for MODRINTH_PROJECTS (#3720) 2025-10-18 18:44:59 -05:00
Geoff Bourne
66f26c0ea8 build: install latest gosu from published image (#3717) 2025-10-17 19:10:00 -05:00
Geoff Bourne
998b61de0d Improve variable naming with MODRINTH_MODPACK_VERSION_TYPE and MODRINTH_PROJECTS_DEFAULT_VERSION_TYPE (#3716) 2025-10-17 17:05:09 -05:00
Berke Batmaz
532f906d32 Update GTNH example to use Java 25 (#3715) 2025-10-17 06:59:09 -05:00
EmilyxFox
d45c931c92 add management-server-allowed-origins from 25w42a (#3711) 2025-10-14 20:43:53 -05:00
Geoff Bourne
62897044a3 Generalize DOWNLOAD_EXTRA_CONFIGS into APPLY_EXTRA_FILES (#3710) 2025-10-14 17:56:41 -05:00
Geoff Bourne
cfa44414da examples: add bentobox example using DOWNLOAD_EXTRA_CONFIGS (#3708) 2025-10-12 17:26:59 -05:00
Geoff Bourne
aaba3902ca Revert "docs: removing setupmc linkage pending sponsorship arrangement" (#3707) 2025-10-12 13:06:19 -05:00
Geoff Bourne
9ff2f8f671 Allow embedded comments in newline-comma lists (#3705) 2025-10-12 13:02:02 -05:00
Geoff Bourne
009412e52c docs: removing setupmc linkage pending sponsorship arrangement (#3706) 2025-10-12 12:11:02 -05:00
80 changed files with 2314 additions and 815 deletions

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text eol=lf

15
.github/workflows/auto-release.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Auto release
on:
schedule:
- cron: "0 14 * * *"
workflow_dispatch:
jobs:
auto-release:
runs-on: ubuntu-latest
steps:
- uses: zenengeo/github-auto-release-action@main
with:
stable-duration: 3d
force-duration: 14d
token: '${{ secrets.GH_TOKEN }}'

View File

@@ -22,6 +22,7 @@ jobs:
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
variant:
- java25
- java25-jdk
- java25-graalvm
- java21
- java21-alpine
@@ -29,12 +30,10 @@ jobs:
- java21-jdk
- java17
- java17-graalvm
- java17-alpine
- java16
- java11
- java8
- java8-graalvm-ce
- java8-openj9
- java8-jdk
include:
# JAVA 25
@@ -42,13 +41,17 @@ jobs:
baseImage: eclipse-temurin:25-jre
platforms: linux/amd64,linux/arm64
mcVersion: latest
- variant: java25-jdk
baseImage: eclipse-temurin:25
platforms: linux/amd64,linux/arm64
mcVersion: latest
- variant: java25-graalvm
baseImage: container-registry.oracle.com/graalvm/jdk:25-ol8
baseImage: container-registry.oracle.com/graalvm/jdk:25-ol10
platforms: linux/amd64,linux/arm64
mcVersion: latest
# JAVA 21:
- variant: java21-graalvm
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol8
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol10
platforms: linux/amd64,linux/arm64
mcVersion: latest
- variant: java21
@@ -70,13 +73,9 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.20.4
- variant: java17-graalvm
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol8
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol10
platforms: linux/amd64,linux/arm64
mcVersion: 1.20.4
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.20.4
# JAVA 16
- variant: java16
baseImage: adoptopenjdk:16-jre-hotspot
@@ -105,12 +104,6 @@ jobs:
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
# Pin version for Java 8
# mcHelperVersion: 1.46.0
- variant: java8-openj9
baseImage: ibm-semeru-runtimes:open-8u312-b07-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
# Pin version for Java 8
# mcHelperVersion: 1.46.0
env:
IMAGE_TO_TEST: "${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}"
@@ -119,14 +112,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
uses: actions/checkout@v6.0.0
with:
# for build-files step
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.8.0
uses: docker/metadata-action@v5.10.0
with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced.
@@ -159,7 +152,7 @@ jobs:
uses: docker/setup-buildx-action@v3.11.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0
uses: docker/setup-qemu-action@v3.7.0
- name: Build for test
uses: docker/build-push-action@v6.18.0

View File

@@ -44,13 +44,13 @@ jobs:
platforms: linux/amd64
mcVersion: 1.12.2
# Pin version for Java 8
mcHelperVersion: 1.42.1
# mcHelperVersion: 1.42.1
env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
uses: actions/checkout@v6.0.0
with:
# for build-files step
fetch-depth: 0

View File

@@ -15,6 +15,7 @@ ARG FORCE_INSTALL_PACKAGES=1
RUN --mount=target=/build,source=build \
TARGET=${TARGETARCH}${TARGETVARIANT} \
/build/run.sh install-packages
COPY --from=tianon/gosu /gosu /usr/local/bin/
RUN --mount=target=/build,source=build \
/build/run.sh setup-user
@@ -28,27 +29,27 @@ ARG EASY_ADD_VERSION=0.8.11
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
ARG RESTIFY_VERSION=1.7.10
ARG RESTIFY_VERSION=1.7.11
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG RCON_CLI_VERSION=1.7.1
ARG RCON_CLI_VERSION=1.7.3
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_MONITOR_VERSION=0.15.6
ARG MC_MONITOR_VERSION=0.16.0
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_SERVER_RUNNER_VERSION=1.13.4
ARG MC_SERVER_RUNNER_VERSION=1.14.0
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.49.2
ARG MC_HELPER_VERSION=1.51.1
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
@@ -88,4 +89,8 @@ HEALTHCHECK --start-period=2m --retries=2 --interval=30s CMD mc-health
ARG BUILDTIME=local
ARG VERSION=local
ARG REVISION=local
RUN echo "buildtime=${BUILDTIME}\nversion=${VERSION}\nrevision=${REVISION}" > /etc/image.properties
COPY <<EOF /etc/image.properties
buildtime=${BUILDTIME}
version=${VERSION}
revision=${REVISION}
EOF

View File

@@ -10,7 +10,6 @@ apk add --no-cache -U \
imagemagick \
file \
lsof \
su-exec \
coreutils \
findutils \
procps \

View File

@@ -1,22 +0,0 @@
#!/bin/bash
set -euo pipefail
GOSU_VERSION="1.16"
GOSU_BASE_URL="https://github.com/tianon/gosu/releases/download/$GOSU_VERSION"
case $(uname -m) in
"aarch64")
GOSU_ARCH="gosu-arm64"
;;
"x86_64")
GOSU_ARCH="gosu-amd64"
;;
*)
echo "Architecture not supported!"
exit 1
;;
esac
curl -sL -o /bin/gosu "${GOSU_BASE_URL}/${GOSU_ARCH}"
chmod +x /bin/gosu

View File

@@ -15,7 +15,7 @@ dnf config-manager --set-enabled ol${os_major_version}_codeready_builder
tee /etc/yum.repos.d/ol${os_major_version}-epel.repo <<EOF
[ol${os_major_version}_developer_EPEL]
name=Oracle Linux \$releasever EPEL (\$basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL${os_major_version}/developer/EPEL/\$basearch/
baseurl=https://yum.oracle.com/repo/OracleLinux/OL${os_major_version}$([ "$os_major_version" -ge 10 ] && echo '/0' || echo '')/developer/EPEL/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
@@ -26,6 +26,7 @@ dnf update -y
# Install necessary packages
# shellcheck disable=SC2086
# shellcheck disable=SC2046
dnf install -y \
ImageMagick \
file \
@@ -36,32 +37,33 @@ dnf install -y \
git \
jq \
dos2unix \
mysql \
$([ "$os_major_version" -ge 10 ] && echo 'mysql8.4' || echo 'mysql') \
procps-ng \
tzdata \
rsync \
nano \
unzip \
zstd \
lbzip2 \
$([ "$os_major_version" -ge 10 ] && echo 'bzip2' || echo 'lbzip2') \
libpcap \
libwebp \
findutils \
which \
glibc-langpack-en \
$([ "$os_major_version" -ge 10 ] && echo 'git-lfs' || echo '') \
$([ "$os_major_version" -ge 10 ] && echo 'openssl' || echo '') \
${EXTRA_DNF_PACKAGES}
# Install Git LFS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
dnf update -y
dnf install -y git-lfs
# Install Git LFS through third party repository for older OL releases
if [ "$os_major_version" -lt 10 ]; then
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
dnf update -y
dnf install -y git-lfs
fi
# Clean up DNF when done
dnf clean all
# Install gosu (assuming the script /build/ol/install-gosu.sh exists and is executable)
bash /build/ol/install-gosu.sh
# Download and install patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz

View File

@@ -11,7 +11,6 @@ DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
file \
gosu \
sudo \
net-tools \
iputils-ping \

View File

@@ -1,10 +1,10 @@
FROM python:3.11
RUN pip install --upgrade pip
WORKDIR /mkdocs
RUN --mount=target=/build/requirements.txt,source=docs/requirements.txt \
pip install -r /build/requirements.txt
FROM python:3.11
RUN pip install --upgrade pip
WORKDIR /mkdocs
RUN --mount=target=/build/requirements.txt,source=docs/requirements.txt \
pip install -r /build/requirements.txt
ENTRYPOINT ["mkdocs"]

View File

@@ -19,7 +19,7 @@ If you want to use a file's content for value, such as when using secrets mounte
For example, a `my.cnf` file could contain:
```
```toml
[client]
password = ${CFG_DB_PASSWORD}
```
@@ -50,8 +50,7 @@ REPLACE_ENV_VARIABLES_EXCLUDE_PATHS="/data/plugins/Essentials/userdata /data/plu
Here is a full example where we want to replace values inside a `database.yml`.
```yml
```yaml
---
database:
host: ${CFG_DB_HOST}
@@ -59,10 +58,10 @@ database:
password: ${CFG_DB_PASSWORD}
```
This is how your `docker-compose.yml` file could look like:
This is how your `compose.yaml` file could look like:
```yml
# Other docker-compose examples in /examples
```yaml title="compose.yaml"
# Other docker compose examples in /examples
services:
minecraft:

View File

@@ -10,6 +10,12 @@ By default, the image declares an initial and maximum Java memory-heap limit of
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`.
To have control over heap size, without relying on absolute memory sizes percentages are also supported using `<size>%`.
!!! info "RAMPercentage parameters"
Percentage based heap sizing is enabled using `-XX:InitialRAMPercentage` for `INIT_MEMORY` and `-XX:MaxRAMPercentage` for `MAX_MEMORY`.
For details on the function of these parameters look [here](https://www.baeldung.com/java-jvm-parameters-rampercentage).
!!! example "Using docker run"
```
@@ -37,19 +43,7 @@ The values of all three are passed directly to the JVM and support format/units
MAX_MEMORY: 4G
```
To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 4GB of memory:
!!! example "MaxRAMPercentage using compose file"
```
environment:
MEMORY: ""
JVM_XX_OPTS: "-XX:MaxRAMPercentage=75"
deploy:
resources:
limits:
memory: 4G
```
To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit.
!!! important
The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).
@@ -57,10 +51,10 @@ To let the JVM calculate the heap size from the container declared memory limit,
## Extra JVM Options
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
environment variable. The JVM requires `-XX` options to precede `-X` options, so those can be declared in `JVM_XX_OPTS`. Both variables are space-delimited, raw JVM arguments.
environment variable. If needing to set `-XX` options, then pass those with the `JVM_XX_OPTS` variable instead. Both variables accept space-delimited, raw JVM arguments.
```
docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ...
docker run ... -e JVM_OPTS="-XsomeJVMOption -DpropName=value" ...
```
**NOTE** When declaring `JVM_OPTS` in a compose file's `environment` section with list syntax, **do not** include the quotes:
@@ -68,7 +62,7 @@ docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ...
```yaml
environment:
- EULA=true
- JVM_OPTS=-someJVMOption someJVMOptionValue
- JVM_OPTS=-XsomeJVMOption -DpropName=value
```
Using object syntax is recommended and more intuitive:
@@ -76,9 +70,9 @@ Using object syntax is recommended and more intuitive:
```yaml
environment:
EULA: "true"
JVM_OPTS: "-someJVMOption someJVMOptionValue"
# or
# JVM_OPTS: -someJVMOption someJVMOptionValue
JVM_OPTS: "-XsomeJVMOption -DpropName=value"
# or without quotes
# JVM_OPTS: -XsomeJVMOption -DpropName=value
```
As a shorthand for passing several system properties as `-D` arguments, you can instead pass a comma separated list of `name=value` or `name:value` pairs with `JVM_DD_OPTS`. (The colon syntax is provided for management platforms like Plesk that don't allow `=` inside a value.)

View File

@@ -13,10 +13,11 @@ For VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, CURSEFORGE, SPONGEVANILLA server type
`$FORCE_REDOWNLOAD` to some value (e.g. 'true) to force a re-download of the server file for
the particular server type. by adding a `-e FORCE_REDOWNLOAD=true` to your command-line.
For example, with PaperSpigot, it would look something like this:
For example, with Paper, it would look something like this:
```
docker run -d -v /path/on/host:/data \
docker run -d --pull=always \
-v /path/on/host:/data \
-e TYPE=PAPER -e FORCE_REDOWNLOAD=true \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
@@ -47,7 +48,7 @@ To allow time for players to finish what they're doing during a graceful server
The Docker stop grace period must be increased to a value longer than the announce delay. The value to use that is longer than announce delay will vary based upon the amount of time it takes for final world data saving. If the container exits with exit code 137, then that indicates a longer grace period is needed.
The grace period can be increased using [the -t option on docker-compose down](https://docs.docker.com/compose/reference/down/) or set the [stop_grace_period](https://docs.docker.com/compose/compose-file/05-services/#stop_grace_period) in the compose file.
The grace period can be increased using [the -t option on `docker compose down`](https://docs.docker.com/compose/reference/down/) or set the [stop_grace_period](https://docs.docker.com/compose/compose-file/05-services/#stop_grace_period) in the compose file.
The `STOP_SERVER_ANNOUNCE_DELAY` can be bypassed by sending a `SIGUSR1` signal to the `mc-server-runner` process.
@@ -94,7 +95,7 @@ You can configure the timezone to match yours by setting the `TZ` environment va
such as:
docker run -d -it -e TZ=Europe/London -p 25565:25565 --name mc itzg/minecraft-server
docker run -d -it --pull=always -e TZ=Europe/London -p 25565:25565 --name mc itzg/minecraft-server
Or mounting `/etc/timezone` as readonly (not supported on Windows):
@@ -102,7 +103,7 @@ Or mounting `/etc/timezone` as readonly (not supported on Windows):
such as:
docker run -d -it -v /etc/timezone:/etc/timezone:ro -p 25565:25565 --name mc itzg/minecraft-server
docker run -d -it --pull=always -v /etc/timezone:/etc/timezone:ro -p 25565:25565 --name mc itzg/minecraft-server
## HTTP Proxy
@@ -143,16 +144,6 @@ To enable support for optimized SIMD operations, the JVM flag can be set with th
SIMD optimized operations are supported by Pufferfish and Purpur.
## Downloading extra configuration files
You can download additional configuration files or other resources before the server starts by using the `DOWNLOAD_EXTRA_CONFIGS` environment variable. This is useful for downloading configs that you want to patch or modify during the startup process.
The format uses a `<` separator between the destination path and the source URL:
```
DOWNLOAD_EXTRA_CONFIGS=destination<source_url[,destination2<source_url2,...]
```
For example, to download configuration files for plugins:
```yaml

View File

@@ -414,6 +414,7 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
| HARDCORE | [hardcore](https://minecraft.wiki/w/Server.properties#hardcore) |
| HIDE_ONLINE_PLAYERS | [hide-online-players](https://minecraft.wiki/w/Server.properties#hide-online-players) |
| LOG_IPS | [log-ips](https://minecraft.wiki/w/Server.properties#log-ips) |
| MANAGEMENT_SERVER_ALLOWED_ORIGINS | [management-server-allowed-origins](https://minecraft.wiki/w/Server.properties#management-server-allowed-origins) |
| MANAGEMENT_SERVER_ENABLED | [management-server-enabled](https://minecraft.wiki/w/Server.properties#management-server-enabled) |
| MANAGEMENT_SERVER_HOST | [management-server-host](https://minecraft.wiki/w/Server.properties#management-server-host) |
| MANAGEMENT_SERVER_PORT | [management-server-port](https://minecraft.wiki/w/Server.properties#management-server-port) |

View File

@@ -28,13 +28,14 @@ When attached in this way you can stop the server, edit the configuration under
There might be a safer/better way to accommodate these systems. Please post an issue or PR if you have more information.
With Docker Compose, setting up a host attached directory is even easier since relative paths can be configured. For example, with the following `docker-compose.yml` Docker will automatically create/attach the relative directory `minecraft-data` to the container.
With Docker Compose, setting up a host attached directory is even easier since relative paths can be configured. For example, with the following `compose.yaml` Docker will automatically create/attach the relative directory `minecraft-data` to the container.
``` yaml title="docker-compose.yml"
```yaml title="compose.yaml"
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:latest
pull_policy: daily
ports:
- 25565:25565
environment:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -15,7 +15,28 @@ To simply use the latest stable version, run
docker run -d -it -p 25565:25565 -e EULA=TRUE itzg/minecraft-server
where, in this case, the standard server port 25565, will be exposed on your host machine.
where, in this case, the standard server port 25565 will be exposed on your host machine.
!!! important "Persistent Data"
The Minecraft server will store its data in the container's `/data` directory. This directory can be [mounted](https://docs.docker.com/storage/volumes/) from the host machine or a managed volume.
Using `docker run` add a `-v` option somewhere before the image name:
```
... -v /path/on/host:/data itzg/minecraft-server
```
Using docker compose, add a `volumes` section to the service definition:
```yaml
services:
mc:
# ... image and environment section
volumes:
# attach the relative directory 'data' to the container's /data path
./data:data
```
!!! note
@@ -25,24 +46,21 @@ where, in this case, the standard server port 25565, will be exposed on your hos
Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
!!! warning
**DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/minecraft.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
## Using [Docker Compose](https://docs.docker.com/compose/)
1. Create a new directory
2. Put the contents of the file below in a file called `docker-compose.yml`
2. Put the contents of the file below in a file called `compose.yaml`
3. Run `docker compose up -d` in that directory
4. Done! Point your client at your host's name/IP address and port 25565.
```yaml
```yaml title="compose.yaml"
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:latest
pull_policy: daily
tty: true
stdin_open: true
ports:
@@ -59,7 +77,7 @@ To apply changes made to the compose file, just run `docker compose up -d` again
Follow the logs of the container using `docker compose logs -f`, check on the status with `docker compose ps`, and stop the container using `docker compose stop`.
!!! note "Configurator Tool"
If you prefer to use an interactive tool to create or edit a Docker Compose file for this image, you can check out [setupmc.com's configurator](https://setupmc.com/java-server/). It provides a form that supports most of the image variables and generates the `compose.yml` file in real time.
If you prefer to use an interactive tool to create or edit a Docker Compose file for this image, you can check out [setupmc.com's configurator](https://setupmc.com/java-server/). It provides a form that supports most of the image variables and generates the `compose.yaml` file in real time.
!!! note "More Compose Examples"
There are more [examples located in the Github repo](https://github.com/itzg/docker-minecraft-server/tree/master/examples).

View File

@@ -1,14 +1,14 @@
# Auto-Pause
!!! important
As of [1.21.2](https://minecraft.wiki/w/Java_Edition_1.21.2) it is not recommend to use this feature since Minecraft server natively auto-pauses when the server is empty. That is configured via the enivironment variable `PAUSE_WHEN_EMPTY_SECONDS`, which maps to the `pause-when-empty-seconds` server property.
!!! important
As of [1.21.2](https://minecraft.wiki/w/Java_Edition_1.21.2) it is not recommend to use this feature since Minecraft server natively auto-pauses when the server is empty. That is configured via the enivironment variable `PAUSE_WHEN_EMPTY_SECONDS`, which maps to the `pause-when-empty-seconds` server property.
An auto-pause functionality is provided that monitors whether clients are connected to the server. If a client is not connected for a specified time, the Java process is put into a pause state. When a client attempts to connect while the process is paused, then process will be restored to a running state. The experience for the client does not change. This feature can be enabled by setting the environment variable `ENABLE_AUTOPAUSE` to "true".
!!! important
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](../../configuration/server-properties.md#max-tick-time).
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [server properties](../../configuration/server-properties.md).
Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately. For PaperMC servers, you need to send the JVM flag `-Ddisable.watchdog=true`, this can be done with the docker env variable `-e JVM_DD_OPTS=disable.watchdog:true`

View File

@@ -21,8 +21,8 @@ $env:FOLDER_TO_TEST="forgeapimods_projectids"
$env:IMAGE_TO_TEST="mc-dev"
docker build -t $env:IMAGE_TO_TEST .
pushd "tests/setuponlytests/$env:FOLDER_TO_TEST/"
docker-compose run mc
docker-compose down -v --remove-orphans
docker compose run mc
docker compose down -v --remove-orphans
popd
```
@@ -39,8 +39,8 @@ export FOLDER_TO_TEST="forgeapimods_file"
export IMAGE_TO_TEST="mc-dev"
docker build -t $IMAGE_TO_TEST .
pushd tests/setuponlytests/$FOLDER_TO_TEST/
docker-compose run mc
docker-compose down -v --remove-orphans
docker compose run mc
docker compose down -v --remove-orphans
popd
```
@@ -92,6 +92,16 @@ docker run -it --rm \
itzg/minecraft-server
```
In a compose file, include the volume mount in the `volumes` section of the container definition:
```yaml
services:
mc:
# ... usual container definition
volumes:
- /path/to/mc-image-helper/build/install/mc-image-helper:/usr/share/mc-image-helper:ro
```
For Go base tools, run
```shell

View File

@@ -6,11 +6,12 @@ Various examples are [maintained in the repository](https://github.com/itzg/dock
Using the [GeyserMC plugin](https://geysermc.org/) with a Paper server (or similar) "enables clients from Minecraft Bedrock Edition to join your Minecraft Java server". The example also includes [Floodgate](https://wiki.geysermc.org/floodgate/) which "allows Xbox Live authenticated Bedrock users to join without a Java Edition account".
```yaml
```yaml title="compose.yaml"
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:latest
pull_policy: daily
environment:
EULA: "true"
TYPE: "PAPER"
@@ -30,7 +31,7 @@ services:
With [lazymc-docker-proxy](https://github.com/joesturge/lazymc-docker-proxy) you are able to use [lazymc](https://github.com/timvisee/lazymc) with the minecraft container.
```yaml
```yaml title="compose.yaml"
# Lazymc requires that the minecraft server have a static IP.
#
# To ensure that our servers have a static IP we need to create
@@ -72,6 +73,7 @@ services:
# Standard Docker Minecraft server, also works with other server types
mc:
image: itzg/minecraft-server:java21
pull_policy: daily
# Assign a static IP to the server container
networks:
minecraft-network:
@@ -105,7 +107,7 @@ Monitors network traffic to the Minecraft containers. If there is traffic, the c
By using [Lazytainer](https://github.com/vmorganp/Lazytainer) with the [docker-minecraft-server](https://github.com/itzg/docker-minecraft-server) a somehow similar behaviour to [Lazymc](https://github.com/timvisee/lazymc) can be archived.
```yaml
```yaml title="compose.yaml"
services:
lazytainer:
image: ghcr.io/vmorganp/lazytainer:master
@@ -123,7 +125,8 @@ services:
restart: unless-stopped
network_mode: bridge
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:latest
pull_policy: daily
environment:
EULA: TRUE
TYPE: PAPER

View File

@@ -1,179 +1,215 @@
# Working with mods and plugins
## Modpack platforms
By far the easiest way to work with mod and plugins, especially large numbers of them, is to utilize modpacks with [one of the supported modpack platforms](../types-and-platforms/index.md).
The following are some supported modpack platforms:
- [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md)
- [CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md)
- [Feed the Beast](../types-and-platforms/mod-platforms/ftb.md)
## Download automation
On the left, there are sections describing some download automation options.
## Mods vs Plugins
The terms "mods" and "plugins" can be quite confusing. Generally, the rule of thumb is that "mods" are used by the types that run client side to modify rendering, add new blocks, and add behaviors server, such as [Forge](../types-and-platforms/server-types/forge.md) and [Fabric](../types-and-platforms/server-types/fabric.md). "Plugins" are used by the types that **only run on servers** to add behaviors, commands, etc such as [Paper](../types-and-platforms/server-types/paper.md) (which derives from [Bukkit/Spigot](../types-and-platforms/server-types/bukkit-spigot.md)). There are also some types that are [hybrids](../types-and-platforms/server-types/hybrids.md), such as Magma, that use both "mods" and "plugins".
Typically, mods needs to be installed in both the client and server; however, there are some cases when only the server needs a mod. Plugins only need to be installed in the server and are never needed in the client.
## Optional plugins, mods, and config attach points
There are optional volume paths that can be attached to supply content to be copied into the data area:
`/plugins`
: content in this directory is synchronized into `/data/plugins` for server types that use plugins, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_PLUGINS_SRC` and destination by setting `COPY_PLUGINS_DEST`. If using a mod-based loader, such as Forge or Fabric, but a hybrid mod like [Cardboard](https://modrinth.com/mod/cardboard), then set `USES_PLUGINS` to have the automation utilize `/plugins` mount.
`/mods`
: content in this directory is synchronized into `/data/mods` for server types that use mods, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_MODS_SRC` and destination by setting `COPY_MODS_DEST`.
`/config`
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. The source can be changed by setting `COPY_CONFIG_SRC`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
By default, the [environment variable processing](../configuration/interpolating.md) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.
If you want old mods/plugins to be removed before the content is brought over from those attach points, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables, which are comma separated lists of file glob patterns. If a directory is excluded, then it and all of its contents are excluded. By default, only jars are removed.
You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
These paths work well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
!!! information "Multiple source directories"
`COPY_PLUGINS_SRC`, `COPY_MODS_SRC`, `COPY_CONFIG_SRC` can each be set to a comma or newline delimited list of container directories to reference.
For example, in a compose file:
```yaml
environment:
# ...EULA, etc
TYPE: PAPER
# matches up to volumes declared below
COPY_PLUGINS_SRC: /plugins-common,/plugins-local
volumes:
- mc-data:/data
# For example, reference a shared directory used by several projects
- ../plugins-common:/plugins-common:ro
# and add plugins unique to this project
- ./plugins:/plugins-local:ro
```
Alternatively, you can declare other directories along with files and URLs to use in [the `MODS` / `PLUGINS` variables](#modsplugins-list).
## Zip file modpack
Like the `WORLD` option above, you can specify the URL or container path of a "mod pack" to download and install into `mods` for Forge/Fabric or `plugins` for Bukkit/Spigot. To use this option pass the environment variable `MODPACK`, such as
```shell
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
```
!!! note
The referenced URL/file must be a zip file with one or more jar files at the
top level of the zip archive. Make sure the jars are compatible with the
particular `TYPE` of server you are running.
## Generic pack files
To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
To avoid repetition, each entry will be prefixed by the value of `GENERIC_PACKS_PREFIX` and suffixed by the value of `GENERIC_PACKS_SUFFIX`, both of which are optional. For example, the following variables
```
GENERIC_PACKS=configs-v9.0.1,mods-v4.3.6
GENERIC_PACKS_PREFIX=https://cdn.example.org/
GENERIC_PACKS_SUFFIX=.zip
```
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update can be time-consuming. To skip the update set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
The most time-consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true".
To disable specific mods, which can be useful for conflicts between multiple generic packs, you can use the `GENERIC_PACKS_DISABLE_MODS` variable to specify mods to disable.
Disabling mods with docker run:
```shell
docker run -d -e GENERIC_PACKS_DISABLE_MODS="mod1.jar mod2.jar" ...
```
Disabling mods within docker compose files:
```yaml
GENERIC_PACKS_DISABLE_MODS: |
mod1.jar
mod2.jar
```
## Mods/plugins list
You may also download or copy over individual mods/plugins using the `MODS` or `PLUGINS` environment variables. Both are a comma or newline delimited list of
- URL of a jar file
- container path to a jar file
- container path to a directory containing jar files
```shell
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
```
The newline delimiting allows for compose file usage like:
```yaml
PLUGINS: |
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
```
!!! note "Auto-removal"
Entries that are removed from the `MODS` or `PLUGINS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODS` or `PLUGINS` list will remove all mods/plugins.
!!! note "Disable processing"
To temporarily disable processing of the `MODS` or `PLUGINS` list, then comment out the `MODS` or `PLUGINS` environment variable.
## Mod/Plugin URL Listing File
As an alternative to `MODS`/`PLUGINS`, the variable `MODS_FILE` or `PLUGINS_FILE` can be set with the container path or URL of a text file listing a mod/plugin URLs on each line. For example, the following
-e MODS_FILE=/extras/mods.txt
would load from a file mounted into the container at `/extras/mods.txt`. That file might look like:
```text
https://edge.forgecdn.net/files/2965/233/Bookshelf-1.15.2-5.6.40.jar
https://edge.forgecdn.net/files/2926/27/ProgressiveBosses-2.1.5-mc1.15.2.jar
# This and next line are ignored
#https://edge.forgecdn.net/files/3248/905/goblintraders-1.3.1-1.15.2.jar
https://edge.forgecdn.net/files/3272/32/jei-1.15.2-6.0.3.16.jar
https://edge.forgecdn.net/files/2871/647/ToastControl-1.15.2-3.0.1.jar
```
!!! note
Blank lines and lines that start with a `#` will be ignored
[This compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/mods-file/docker-compose.yml) shows another example of using this feature.
## Remove old mods/plugins
When the `MODPACK` option above is specified you can also instruct script to delete old mods/plugins prior to installing new ones. This behaviour is desirable in case you want to upgrade mods/plugins from downloaded zip file.
To use this option pass the environment variable `REMOVE_OLD_MODS=TRUE`, such as
```shell
docker run -d -e REMOVE_OLD_MODS=TRUE -e MODPACK=http://www.example.com/mods/modpack.zip ...
```
!!! danger
All content of the `mods` or `plugins` directory will be deleted before unpacking new content from the MODPACK or MODS.
# Working with mods and plugins
## Modpack platforms
By far the easiest way to work with mod and plugins, especially large numbers of them, is to utilize modpacks with [one of the supported modpack platforms](../types-and-platforms/index.md).
The following are some supported modpack platforms:
- [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md)
- [CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md)
- [Feed the Beast](../types-and-platforms/mod-platforms/ftb.md)
## Download automation
On the left, there are sections describing some download automation options.
## Mods vs Plugins
The terms "mods" and "plugins" can be quite confusing. Generally, the rule of thumb is that "mods" are used by the types that run client side to modify rendering, add new blocks, and add behaviors server, such as [Forge](../types-and-platforms/server-types/forge.md) and [Fabric](../types-and-platforms/server-types/fabric.md). "Plugins" are used by the types that **only run on servers** to add behaviors, commands, etc such as [Paper](../types-and-platforms/server-types/paper.md) (which derives from [Bukkit/Spigot](../types-and-platforms/server-types/bukkit-spigot.md)). There are also some types that are [hybrids](../types-and-platforms/server-types/hybrids.md), such as Magma, that use both "mods" and "plugins".
Typically, mods needs to be installed in both the client and server; however, there are some cases when only the server needs a mod. Plugins only need to be installed in the server and are never needed in the client.
## Optional plugins, mods, and config attach points
There are optional volume paths that can be attached to supply content to be copied into the data area:
`/plugins`
: content in this directory is synchronized into `/data/plugins` for server types that use plugins, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_PLUGINS_SRC` and destination by setting `COPY_PLUGINS_DEST`. If using a mod-based loader, such as Forge or Fabric, but a hybrid mod like [Cardboard](https://modrinth.com/mod/cardboard), then set `USES_PLUGINS` to have the automation utilize `/plugins` mount.
!!! example "Using Cardboard plugins with Fabric"
```yaml
environment:
EULA: "TRUE"
TYPE: "FABRIC"
MODRINTH_PROJECTS: |
fabric-api
cardboard
USES_PLUGINS: true
```
`/mods`
: content in this directory is synchronized into `/data/mods` for server types that use mods, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_MODS_SRC` and destination by setting `COPY_MODS_DEST`.
`/config`
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. The source can be changed by setting `COPY_CONFIG_SRC`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
By default, the [environment variable processing](../configuration/interpolating.md) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.
If you want old mods/plugins to be removed before the content is brought over from those attach points, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables, which are comma separated lists of file glob patterns. If a directory is excluded, then it and all of its contents are excluded. By default, only jars are removed.
You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
These paths work well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
!!! information "Multiple source directories"
`COPY_PLUGINS_SRC`, `COPY_MODS_SRC`, `COPY_CONFIG_SRC` can each be set to a comma or newline delimited list of container directories to reference.
For example, in a compose file:
```yaml
environment:
# ...EULA, etc
TYPE: PAPER
# matches up to volumes declared below
COPY_PLUGINS_SRC: /plugins-common,/plugins-local
volumes:
- mc-data:/data
# For example, reference a shared directory used by several projects
- ../plugins-common:/plugins-common:ro
# and add plugins unique to this project
- ./plugins:/plugins-local:ro
```
Alternatively, you can declare other directories along with files and URLs to use in [the `MODS` / `PLUGINS` variables](#modsplugins-list).
## Applying extra configuration files
You can download/copy additional configuration files or other resources before the server starts by using the `APPLY_EXTRA_FILES` environment variable. This is useful for downloading configs that you want to patch or modify during the startup process.
The format uses a `<` separator between the destination path and the source URL/path. The destination path is relative to the `/data` directory. If specifying a source path, it needs to be path mounted within the container.
!!! example
With `docker run`
```
-e APPLY_EXTRA_FILES=destination<source_url[,destination2<source_url2,...]
```
With a compose file:
```yaml
environment:
APPLY_EXTRA_FILES: |
destination<source1_url
destination2<source2_path
```
!!! tip "Patch-able"
The `APPLY_EXTRA_FILES` feature is processed prior to [patch processing](../configuration/interpolating.md#patching-existing-files), so this can be used as for baseline files to be patched further at runtime.
## Zip file modpack
Like the `WORLD` option above, you can specify the URL or container path of a "mod pack" to download and install into `mods` for Forge/Fabric or `plugins` for Bukkit/Spigot. To use this option pass the environment variable `MODPACK`, such as
```shell
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
```
!!! note
The referenced URL/file must be a zip file with one or more jar files at the
top level of the zip archive. Make sure the jars are compatible with the
particular `TYPE` of server you are running.
## Generic pack files
To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
To avoid repetition, each entry will be prefixed by the value of `GENERIC_PACKS_PREFIX` and suffixed by the value of `GENERIC_PACKS_SUFFIX`, both of which are optional. For example, the following variables
```
GENERIC_PACKS=configs-v9.0.1,mods-v4.3.6
GENERIC_PACKS_PREFIX=https://cdn.example.org/
GENERIC_PACKS_SUFFIX=.zip
```
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update can be time-consuming. To skip the update set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
The most time-consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true".
To disable specific mods, which can be useful for conflicts between multiple generic packs, you can use the `GENERIC_PACKS_DISABLE_MODS` variable to specify mods to disable.
Disabling mods with docker run:
```shell
docker run -d -e GENERIC_PACKS_DISABLE_MODS="mod1.jar mod2.jar" ...
```
Disabling mods within docker compose files:
```yaml
GENERIC_PACKS_DISABLE_MODS: |
mod1.jar
mod2.jar
```
## Mods/plugins list
You may also download or copy over individual mods/plugins using the `MODS` or `PLUGINS` environment variables. Both are a comma or newline delimited list of
- URL of a jar file
- container path to a jar file
- container path to a directory containing jar files
```shell
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
```
The newline delimiting allows for compose file usage like:
```yaml
PLUGINS: |
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
```
!!! note "Auto-removal"
Entries that are removed from the `MODS` or `PLUGINS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODS` or `PLUGINS` list will remove all mods/plugins.
!!! note "Disable processing"
To temporarily disable processing of the `MODS` or `PLUGINS` list, then comment out the `MODS` or `PLUGINS` environment variable.
## Mod/Plugin URL Listing File
As an alternative to `MODS`/`PLUGINS`, the variable `MODS_FILE` or `PLUGINS_FILE` can be set with the container path or URL of a text file listing a mod/plugin URLs on each line. For example, the following
-e MODS_FILE=/extras/mods.txt
would load from a file mounted into the container at `/extras/mods.txt`. That file might look like:
```text
https://edge.forgecdn.net/files/2965/233/Bookshelf-1.15.2-5.6.40.jar
https://edge.forgecdn.net/files/2926/27/ProgressiveBosses-2.1.5-mc1.15.2.jar
# This and next line are ignored
#https://edge.forgecdn.net/files/3248/905/goblintraders-1.3.1-1.15.2.jar
https://edge.forgecdn.net/files/3272/32/jei-1.15.2-6.0.3.16.jar
https://edge.forgecdn.net/files/2871/647/ToastControl-1.15.2-3.0.1.jar
```
!!! note
Blank lines and lines that start with a `#` will be ignored
[This compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/mods-file/docker-compose.yml) shows another example of using this feature.
## Remove old mods/plugins
When the `MODPACK` option above is specified you can also instruct script to delete old mods/plugins prior to installing new ones. This behaviour is desirable in case you want to upgrade mods/plugins from downloaded zip file.
To use this option pass the environment variable `REMOVE_OLD_MODS=TRUE`, such as
```shell
docker run -d -e REMOVE_OLD_MODS=TRUE -e MODPACK=http://www.example.com/mods/modpack.zip ...
```
!!! danger
All content of the `mods` or `plugins` directory will be deleted before unpacking new content from the MODPACK or MODS.

View File

@@ -4,7 +4,29 @@
## Usage
To use this feature, set the environment variable `MODRINTH_PROJECTS` to a comma or newline separated list of project slugs (short name) or IDs.
To use this feature, set the environment variable `MODRINTH_PROJECTS` to a comma or newline separated list of projects.
Each project entry can be any of the following combinations where a colon (`:`) is used to separate the different parts:
```
Project
Project : Version
Project : Release Type
Prefix : Project
Prefix : Project : Version
Prefix : Project : Release Type
@ Listing File
```
Where:
- **Project** is the project slug or ID, see below
- **Version** is the version ID (such as "Oa9ZDzZq") or number (such as "2.21.2"). When omitted, the latest release version will be selected. Using version ID will override Minecraft and loader compatibility checks.
- **Release Type** is `release`, `beta`, or `alpha` indicating the latest version to select.
- **Prefix** is `datapack`, `fabric`, `forge`, or `paper`
- The `datapack` prefix is optional when running a vanilla server
- The `fabric`, `forge`, and `paper` prefixes allow for installing mods/plugins that differ from server's `TYPE`. Using [Sinytra Connector](https://modrinth.com/mod/connector) is an example of this, where Fabric mods can be loaded into a NeoForge server.
- **Listing file** is a container path to a file containing a list of projects
!!! tip "Project ID"
@@ -14,20 +36,15 @@ To use this feature, set the environment variable `MODRINTH_PROJECTS` to a comma
!!! tip "Project Slug"
The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example:
```
https://modrinth.com/mod/fabric-api
----------
|
+-- project slug
```
The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example, this one is "essentialsx".
Also, a specific version (or release type) can be declared by adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
![](../img/modrinth-plugin-project-slug.png)
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
!!! tip "Version number and ID"
You can also reference a file containing project entries by prefixing the **container path** path with `@`.
The version number and ID are located in the metadata panel on a version specific page, such as <https://modrinth.com/plugin/essentialsx/version/2.21.2>
![Version ID](../img/modrinth-version-id.drawio.png)
### Examples
@@ -39,6 +56,7 @@ You can also reference a file containing project entries by prefixing the **cont
| Latest version using project ID | `P7dR8mSH` |
| Latest version of datapack | `datapack:terralith` |
| Specific version of datapack | `datapack:terralith:2.5.5` |
| Mod loader override | `fabric:fabric-api`<br/>`fabric:fabric-api:bQZpGIz0` |
| Projects Listing File | `@/path/to/modrinth-mods.txt` |
### Notes
@@ -92,7 +110,7 @@ When the environment variable `VERSION_FROM_MODRINTH_PROJECTS` is set to "true"
`MODRINTH_DOWNLOAD_DEPENDENCIES`
: Can be set to `none` (the default), `required`, or `optional` to download required and/or optional dependencies.
`MODRINTH_ALLOWED_VERSION_TYPE`
`MODRINTH_PROJECTS_DEFAULT_VERSION_TYPE`
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`. Setting to `beta` will pick up both release and beta versions. Setting to `alpha` will pick up release, beta, and alpha versions.
`MODRINTH_LOADER`

View File

@@ -5,7 +5,8 @@
To configure server mods using a packwiz modpack, set the `PACKWIZ_URL` environment variable to the location of your `pack.toml` modpack definition:
```
docker run -d -v /path/on/host:/data -e TYPE=FABRIC \
docker run -d --pull=always \
-v /path/on/host:/data -e TYPE=FABRIC \
-e "PACKWIZ_URL=https://example.com/modpack/pack.toml" \
itzg/minecraft-server
```

View File

@@ -1,7 +1,10 @@
mkdocs-material == 9.6.21
mkdocs-autorefs == 1.4.3
mkdocstrings[python] == 0.30.1
mkdocs-literate-nav == 0.6.2
mdx-gh-links == 0.4
mkdocs-click == 0.9.0
mkdocs-material == 9.7.0
mkdocs-autorefs == 1.4.3
mkdocstrings[python] == 0.30.1
mkdocs-literate-nav == 0.6.2
mdx-gh-links == 0.4
# need to pin for auto reload to work
# see https://github.com/mkdocs/mkdocs/issues/4032
click==8.2.1
mkdocs-click == 0.9.0
mkdocs-static-i18n == 1.3.0

View File

@@ -1,5 +1,5 @@
---
title: Sending commands
title: With Docker
---
[RCON](http://wiki.vg/RCON) is enabled by default, so you can `exec` into the container to
@@ -66,4 +66,4 @@ and then Control-p Control-q to **detach**.
!!! info "RCON is required for fully interactive, color console"
RCON must be enabled, which is the default, in order to use a fully interactive console with auto-completion and colorized log output.
RCON must be enabled, which is the default, in order to use a fully interactive console with auto-completion and colorized log output.

View File

@@ -0,0 +1,81 @@
---
title: With websocket
---
With `WEBSOCKET_CONSOLE` set to `true`, logs can be streamed, and commands sent, over a websocket connection.
The API is available on `/websocket`.
## Password
A password must be supplied using the `Sec-WebSocket-Protocol` header. This is done by putting `mc-server-runner-ws-v1` in the first slot, and the password in the second. The password can be set with `RCON_PASSWORD` or `WEBSOCKET_PASSWORD`. The latter overwrites the former. Authentication can be disabled with `WEBSOCKET_DISABLE_AUTHENTICATION`.
??? Example "Examples"
```js title="JavaScript example"
let socket = new WebSocket("http://localhost:80/websocket", ["mc-server-runner-ws-v1", "rcon-password"]);
```
## Allowed origins
A list of comma-separated allowed origins should be supplied with `WEBSOCKET_ALLOWED_ORIGINS`. Origin checking can be disabled with `WEBSOCKET_DISABLE_ORIGIN_CHECK`.
## Listen address
The listen address and port can be set with `WEBSOCKET_ADDRESS` (defaults to `0.0.0.0:80`), but it's recommended to listen on all interfaces when running in Docker.
## Log history
When a connection is established, the last 50 (by default, configurable with `WEBSOCKET_LOG_BUFFER_SIZE`) log lines are sent with a `logHistory` type message.
??? tip "Tip: Remember to forward the websocket port on the host"
```yaml title="compose.yaml"
services:
mc:
ports:
- '25565:25565'
- '80:80'
```
## Environment variables
| Environment Variable | Usage | Default |
| ---------------------------------- | ---------------------------------------------------------- | ------------ |
| `WEBSOCKET_CONSOLE` | Allow remote shell over websocket | `false` |
| `WEBSOCKET_ADDRESS` | Bind address for websocket server | `0.0.0.0:80` |
| `WEBSOCKET_DISABLE_ORIGIN_CHECK` | Disable checking if origin is trusted | `false` |
| `WEBSOCKET_ALLOWED_ORIGINS` | Comma-separated list of trusted origins | ` ` |
| `WEBSOCKET_PASSWORD` | Password will be the same as RCON_PASSWORD if unset | ` ` |
| `WEBSOCKET_DISABLE_AUTHENTICATION` | Disable websocket authentication | `false` |
| `WEBSOCKET_LOG_BUFFER_SIZE` | Number of log lines to save and send to connecting clients | `50` |
## API Schema
```ts title="API Schema"
interface StdinMessage {
type: "stdin";
data: string;
}
interface StdoutMessage {
type: "stdout";
data: string;
}
interface StderrMessage {
type: "stderr";
data: string;
}
interface LogHistoryMessage {
type: "logHistory";
lines: string[];
}
interface AuthFailureMessage {
type: "authFailure";
reason: string;
}
// Messages sent from Client -> Server
export type ClientMessage = StdinMessage;
// Messages sent from Server -> Client
export type ServerMessage =
| StdoutMessage
| StderrMessage
| LogHistoryMessage
| AuthFailureMessage;
```

View File

@@ -7,58 +7,55 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
!!! warning "CurseForge API key usage"
A CurseForge API key is **required** to use this feature. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable `CF_API_KEY`.
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`. Refer to [this compose file reference section](https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution) for more information.
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
```yaml
# compose.yaml
```yaml title="compose.yaml"
environment:
CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
```
If you use `docker run` you will need to make sure to use single quotes:
```shell
docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
```
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). You **do not** need to escape `$`'s with a second `$` in the `.env` file **as long as the key is wrapped in single quotes**.
```
# .env
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). You **do not** need to escape `$`'s with a second `$` in the `.env` file **as long as the key is wrapped in single quotes**.
```title=".env"
CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
```
The variable should to be referenced from the compose file, such as:
```yaml
# compose.yaml
```yaml title="compose.yaml"
environment:
CF_API_KEY: ${CF_API_KEY}
```
The .env file should be placed in the same directory as your compose file like so:
```
/minecraft-server
minecraft-server/
├── .env
├── compose.yaml
├── /data
├── data/
```
To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
```
```shell
docker run --env-file=.env itzg/minecraft-server
```
Alternately you can use [docker secrets](https://docs.docker.com/compose/how-tos/use-secrets/) with a `CF_API_KEY_FILE` environment variable:
```
```yaml title="compose.yaml"
service:
environment:
CF_API_KEY_FILE: /run/secrets/cf_api_key
secrets:
- cf_api_key
secrets:
cf_api_key:
file: cf_api_key.secret
@@ -67,27 +64,48 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
!!! note
Be sure to use the appropriate [image tag for the Java version compatible with the modpack](../../versions/java.md).
Most modpacks require a good amount of memory, so it best to set `MEMORY` to at least "4G" since the default is only 1 GB.
## Usage
Use one of the following to specify the modpack to install:
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". For example:
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390".
```
-e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
```
!!! example "Using CF_PAGE_URL"
```yaml title="Using compose.yaml"
environment:
# ...
MODPACK_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
```
```title="Using docker run"
docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
```
Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as
![cf-slug](../../img/cf-slug.png)
For example:
```
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
```
!!! example "Using CF_SLUG"
```yaml title="Using compose.yaml"
environment:
# ...
MODPACK_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: all-the-mods-8
```
```title="Using docker run"
docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
```
### Pinning modpack and mod loader versions
@@ -119,6 +137,30 @@ The following examples all refer to version 1.0.7 of ATM8:
Pinning modpack version also pins the mod loader (to the version specified by the modpack). Mod loader version cannot be pinned independently of the modpack.
### Custom modloader versions
By default, AUTO_CURSEFORGE will use the exact modloader version declared by the modpack. However, you can override the modloader version by setting the following environment variable:
- `CF_MOD_LOADER_VERSION`: Override the mod loader version (e.g., `43.4.22`)
!!! example "Override mod loader version"
```yaml
environment:
MODPACK_PLATFORM: AUTO_CURSEFORGE
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: all-the-mods-8
CF_MOD_LOADER_VERSION: "43.4.22"
```
```title="Using docker run"
docker run -e CF_MOD_LOADER_VERSION=43.4.22 -e CF_SLUG=my-fabric-pack ...
```
!!! warning "Compatibility"
Using a custom modloader version that differs significantly from what the modpack was designed for may cause compatibility issues. Use this feature carefully and test thoroughly.
## Manual Downloads
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
@@ -130,12 +172,12 @@ For mod, modpacks, and world files that are not allowed for automated download,
!!! example
Assuming Docker compose is being used:
1. Create a directory next to the `docker-compose.yml` file. The name doesn't matter, but "downloads" is the common convention
1. Create a directory next to the `compose.yaml` file. The name doesn't matter, but "downloads" is the common convention
2. From the "Mods Need Download" output, visit the download page of each, click on the file download and save that file into the directory created in the previous step
3. Add a host directory mount to the volumes section where the container path **must be** `/downloads`. The snippet below shows how that will look
4. Re-run `docker compose up -d` to apply the changes
```yaml
volumes:
./downloads:/downloads
@@ -150,7 +192,8 @@ If you wish to use an unpublished modpack zip, set the container path to the fil
```yaml
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:latest
pull_policy: daily
environment:
EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE
@@ -163,7 +206,7 @@ If you wish to use an unpublished modpack zip, set the container path to the fil
```
where an exported manifest file should look like:
```json
{
"minecraft": {
@@ -197,13 +240,13 @@ If you wish to use an unpublished modpack zip, set the container path to the fil
## Exclude client mods
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods:
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes some options to exclude/include mods:
Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given. Alternatively, all mods can be excluded by setting `CF_EXCLUDE_ALL_MODS` to `true`
!!! note
`CF_FORCE_INCLUDE_MODS` will not download additional mods.
For additional mods, refer to [the `CURSEFORGE_FILES` variable](../../mods-and-plugins/curseforge-files.md).
A mod's project ID can be obtained from the right hand side of the project page:
@@ -216,9 +259,20 @@ If needing to iterate on the options above, set `CF_FORCE_SYNCHRONIZE` to "true"
!!! important
These options are provided to empower you to get your server up and running quickly. Please help out by reporting an issue with the respective mod project. Ideally mod developers should [use correct registrations for one-sided client mods](https://docs.minecraftforge.net/en/latest/concepts/sides/#writing-one-sided-mods). Understandably, those code changes may be non-trivial, so mod authors can also add "Client" to the game versions when publishing.
!!! tip "Embedded comments"
Comments can be embedded in the list using the `#` character.
```yaml
CF_EXCLUDE_MODS: |
# Exclude client-side mods not published correctly
creative-core
default-options
```
## Excluding Overrides Files
Modpack zip files typically include an `overrides` subdirectory that may contain config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `CF_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
Modpack zip files typically include an `overrides` subdirectory that may contain config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `CF_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
### Ant-style paths
@@ -231,15 +285,15 @@ Ant-style paths can include the following globbing/wildcard symbols:
| `?` | Matches one character |
!!! example
The following compose `environment` entries show how to exclude Iris and Sodium mods from the overrides
```yaml
CF_OVERRIDES_EXCLUSIONS: mods/iris*.jar,mods/sodium*.jar
```
or using newline delimiter, which improves maintainability
```yaml
CF_OVERRIDES_EXCLUSIONS: |
mods/iris*.jar
@@ -255,7 +309,7 @@ Some modpacks come with world/save data via a worlds file and/or the overrides p
## Ignore missing files
Some mods use temporary files from the modpack and delete them when finished. Others will patch themselves and "disable" the original mod jar, such as gregtech. In order to avoid the installer from detecting the absent file(s) and re-installing, those files can be ignored by passing a comma or newline delimited list to `CF_IGNORE_MISSING_FILES`.
Some mods use temporary files from the modpack and delete them when finished. Others will patch themselves and "disable" the original mod jar, such as gregtech. In order to avoid the installer from detecting the absent file(s) and re-installing, those files can be ignored by passing a comma, newline delimited list, or a file globbing pattern to `CF_IGNORE_MISSING_FILES`.
!!! hint
@@ -272,6 +326,7 @@ Some mods use temporary files from the modpack and delete them when finished. Ot
environment:
CF_IGNORE_MISSING_FILES: |
mods/gregtech-2.6.2-beta.jar
mods/*.jar
```

View File

@@ -11,20 +11,20 @@ variable. A CurseForge server modpack is available together with its respective
client modpack at <https://www.curseforge.com/minecraft/modpacks> .
Now you can add a `-e CF_SERVER_MOD=name_of_modpack.zip` to your command-line.
docker run -d -v /path/on/host:/data -e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```shell
docker run -d --pull=always -v /path/on/host:/data -e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
If you want to keep the pre-download modpacks separate from your data directory,
then you can attach another volume at a path of your choosing and reference that.
The following example uses `/modpacks` as the container path as the pre-download area:
docker run -d -v /path/on/host:/data -v /path/to/modpacks:/modpacks \
-e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=/modpacks/SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```shell
docker run -d --pull=always -v /path/on/host:/data \
-v /path/to/modpacks:/modpacks -e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=/modpacks/SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
### Modpack data directory
By default, CurseForge modpacks are expanded into the sub-directory `/data/FeedTheBeast` and executed from there. (The default location was chosen for legacy reasons, when Curse and FTB were maintained together.)

View File

@@ -30,12 +30,8 @@ If a specific `FTB_MODPACK_VERSION_ID` was not specified, simply restart the con
The following example runs the latest version of [FTB Presents Direwolf20 1.12](https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/):
``` shell
docker run -d --name mc-ftb -e EULA=TRUE \
-e TYPE=FTBA -e FTB_MODPACK_ID=31 \
-p 25565:25565 \
itzg/minecraft-server:java8-multiarch
docker run -d --pull=always -v /path/on/host:/data \
-e EULA=TRUE -e TYPE=FTBA \
-e FTB_MODPACK_ID=31 -p 25565:25565 \
itzg/minecraft-server:java8-multiarch
```
!!! note
Normally you will also add `-v` volume for `/data` since the mods and config are installed there along with world data.

View File

@@ -0,0 +1,54 @@
# Auto-setup GTNH server
[GT New Horizons (GTNH)](https://www.gtnewhorizons.com/) is a Minecraft 1.7.10 modpack maintained and supported by dedicated community members! With over 10 years in development, GTNH offers a carefully balanced and immersive experience to challenge players as they climb through the 15 tiers of technology. The ultimate goal of GTNH is to build the Stargate, an interdimensional teleporter and the symbol for absolute prestige, aptitude, and determination.
As GTNH is a complex modpack with some specifics it has its own `TYPE` to simplify the deployment and update process. To use it set the environment variable `TYPE` to "GTNH".
Configuration options with defaults:
- `GTNH_PACK_VERSION`=latest
- `GTNH_DELETE_BACKUPS`=false
- `SKIP_GTNH_UPDATE_CHECK`=false
## Set Modpack version
As GTNH is a Minecraft 1.7.10 modpack, when using it your minecraft version is set to 1.7.10 by default. The [modpack version](https://www.gtnewhorizons.com/downloads/) can be selected by setting `GTNH_PACK_VERSION` to `latest`, `latest-dev` or any specific version number. `latest` will automatically select the latest full release version available and deploy the server with it (Note: this will also automatically update the server on startup). `latest-dev` does the same but selects the latest version marked as beta or RC (it wont select a full release version even if a newer exist). The third (and recommended) option is setting the server to a specific version like `2.8.1` to manage updates manually.
> To actively prevent an update from happening you can set the environment variable `SKIP_GTNH_UPDATE_CHECK` to true this will prevent any update check from running, but will also prevent the server install from running, so just set it after the initial setup.
## Ressource requirements
**Recommended Minimum:**
- 2-4 cpu cores
- 6GB of RAM +0.5GB per extra player (early game)
- 6GB of RAM +1GB per extra player (~UV tier+)
- 20GB+ storage. HDD is feasible, SSD is preferred
For more details regarding the server setup consult the [modpack wiki](https://wiki.gtnewhorizons.com/wiki/Server_Setup).
## Java Version
GTNH supports java 8 and 17+ (java 17+ is always recommended for maximum performance). The server will only start when a supported version of itzg/docker-minecraft-server is used.
For optimal performance choose java25 with GTNH 2.8.0 and later.
## Config backups
During version upgrade, the server will replace all config files to make sure all new features are setup as intended. The old config files are stored in a backup folder in the data directory, for you to use as reference for manual reapplication of your changed settings. Set the environment variable `GTNH_DELETE_BACKUPS` to true to delete all backup folders at startup.
## server.properties defaults
To deliver the intended GTNH by default, when running a GTNH server, the following options are set in `server.properties`. It is recommended to leave them as is, but if you know what you are doing feel free to play around with them.
- `LEVEL_TYPE=rwg`
- `DIFFICULTY=hard`
- `ALLOW_FLIGHT=true`
- `ENABLE_COMMAND_BLOCK=true`
- `MOTD=Greg Tech New Horizon <current-pack-version>`
## Java args
With java 17+ the server starts with `-Dfml.readTimeout=180 @java9args.txt -jar lwjgl3ify-forgePatches.jar`.
With java 8 the server stars with `-XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseCodeCacheFlushing -Dfml.readTimeout=180 -jar forge-1.7.10-10.13.4.1614-1.7.10-universal.jar`

View File

@@ -1,109 +1,110 @@
# Modrinth Modpacks
[Modrinth Modpacks](https://modrinth.com/modpacks) can automatically be installed along with the required mod loader (Forge or Fabric) by setting `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "MODRINTH". Upgrading (and downgrading) takes care of cleaning up old files and upgrading (and downgrading) the mod loader.
## Modpack project
The desired modpack project is specified with the `MODRINTH_MODPACK` environment variable and must be one of:
- The project "slug", which is located in the URL shown here:
![](../../img/modrinth-project-slug.drawio.png)
- The project ID, which is located in the bottom of the left panel, shown here
![](../../img/modrinth-project-id.drawio.png)
- The project page URL, such as <https://modrinth.com/modpack/cobblemon-fabric>. As described below, this can further be the page URL of a modpack's version page.
- A custom URL of a hosted [mrpack file](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack)
- The container path to a local [mrpack file](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack)
## Modpack version
The automatic modpack version resolving can be narrowed in a few ways:
The latest release or beta version, respectively, of the Modrinth modpack is selected when `VERSION` is "LATEST" or "SNAPSHOT". That can be overridden by setting `MODRINTH_DEFAULT_VERSION_TYPE` to "release", "beta", or "alpha".
The resolved modpack version can be narrowed by setting `VERSION` to a specific Minecraft version, such as "1.19.2".
The selected version can also be narrowed to a particular mod loader by setting `MODRINTH_LOADER` to either "forge", "fabric", or "quilt".
Instead of auto resolving, a specific version of modpack file can be specified by passing the version's page URL to `MODRINTH_MODPACK`, such as <https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2> or by setting `MODRINTH_VERSION` to the version ID or number located in the Metadata section, as shown here
![](../../img/modrinth-version-id.drawio.png)
## Ignore missing files
Some mods, such as [MCInstance Loader](https://modrinth.com/mod/mcinstance-loader), use temporary files from the modpack and delete them when finished. In order to avoid the installer from detecting the absent file(s) and re-installing, those files can be ignored by passing a comma or newline delimited list to `MODRINTH_IGNORE_MISSING_FILES`.
!!! example
In a Compose file
```yaml
environment:
MODRINTH_IGNORE_MISSING_FILES: |
config/mcinstanceloader/pack.mcinstance
```
## Excluding files
To exclude client mods that are incorrectly declared by the modpack as server-compatible, set `MODRINTH_EXCLUDE_FILES` to a comma or newline delimited list of partial file names to exclude. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
!!! example
In a Compose file:
```yaml
MODRINTH_EXCLUDE_FILES: |
notenoughanimations
lambdynamiclights
euphoriapatcher
```
## Force-include files
To force include client mods, set `MODRINTH_FORCE_INCLUDE_FILES` to a comma or newline delimited list of partial file names. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
!!! example
In a Compose file:
```yaml
MODRINTH_FORCE_INCLUDE_FILES: |
yet-another-config-lib
```
## Default exclude/includes
The image comes with a default set of exclude/includes, maintained [in the repo files area](https://github.com/itzg/docker-minecraft-server/blob/master/files/modrinth-exclude-include.json) and uses the same [JSON schema](https://github.com/itzg/mc-image-helper?tab=readme-ov-file#excludeinclude-file-schema) as Auto CurseForge. Those defaults can be disabled by setting the env var `MODRINTH_DEFAULT_EXCLUDE_INCLUDES` to an empty string.
## Excluding Overrides Files
Modrinth mrpack/zip files may include an `overrides` subdirectory that contains config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `MODRINTH_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
### Ant-style paths
Ant-style paths can include the following globbing/wildcard symbols:
| Symbol | Behavior |
|--------|---------------------------------------------------------|
| `*` | Matches zero, one, or many characters except a slash |
| `**` | Matches zero, one, or many characters including slashes |
| `?` | Matches one character |
!!! example
The following compose `environment` entries show how to exclude Iris and Sodium mods from the overrides
```yaml
MODRINTH_OVERRIDES_EXCLUSIONS: mods/NekosEnchantedBooks-*.jar,mods/citresewn-*.jar
```
or using newline delimiter, which improves maintainability
```yaml
MODRINTH_OVERRIDES_EXCLUSIONS: |
mods/NekosEnchantedBooks-*.jar
mods/citresewn-*.jar
```
# Modrinth Modpacks
[Modrinth Modpacks](https://modrinth.com/modpacks) can automatically be installed along with the required mod loader (Forge or Fabric) by setting `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "MODRINTH". Upgrading (and downgrading) takes care of cleaning up old files and upgrading (and downgrading) the mod loader.
## Modpack project
The desired modpack project is specified with the `MODRINTH_MODPACK` environment variable and must be one of:
- The project "slug", which is located in the URL shown here:
![](../../img/modrinth-project-slug.drawio.png)
- The project ID, which is located in the bottom of the left panel, shown here
![](../../img/modrinth-project-id.drawio.png)
- The project page URL, such as <https://modrinth.com/modpack/cobblemon-fabric>. As described below, this can further be the page URL of a modpack's version page.
- A custom URL of a hosted [mrpack file](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack)
- The container path to a local [mrpack file](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack)
## Modpack version
The automatic modpack version resolving can be narrowed in a few ways:
The latest release or beta version, respectively, of the Modrinth modpack is selected when `VERSION` is "LATEST" or "SNAPSHOT". That can be overridden by setting `MODRINTH_MODPACK_VERSION_TYPE` to "release", "beta", or "alpha".
The resolved modpack version can be narrowed by setting `VERSION` to a specific Minecraft version, such as "1.19.2".
The selected version can also be narrowed to a particular mod loader by setting `MODRINTH_LOADER` to either "forge", "fabric", or "quilt".
Instead of auto resolving, a specific version of modpack file can be specified by passing the version's page URL to `MODRINTH_MODPACK`, such as <https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2> or by setting `MODRINTH_VERSION` to the version ID or number located in the Metadata section, as shown here
![](../../img/modrinth-version-id.drawio.png)
## Ignore missing files
Some mods, such as [MCInstance Loader](https://modrinth.com/mod/mcinstance-loader), use temporary files from the modpack and delete them when finished. In order to avoid the installer from detecting the absent file(s) and re-installing, those files can be ignored by passing a comma, newline delimited list or, a file globbing pattern to `MODRINTH_IGNORE_MISSING_FILES`.
!!! example
In a Compose file
```yaml
environment:
MODRINTH_IGNORE_MISSING_FILES: |
config/mcinstanceloader/pack.mcinstance
mods/*.jar
```
## Excluding files
To exclude client mods that are incorrectly declared by the modpack as server-compatible, set `MODRINTH_EXCLUDE_FILES` to a comma or newline delimited list of partial file names to exclude. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
!!! example
In a Compose file:
```yaml
MODRINTH_EXCLUDE_FILES: |
notenoughanimations
lambdynamiclights
euphoriapatcher
```
## Force-include files
To force include client mods, set `MODRINTH_FORCE_INCLUDE_FILES` to a comma or newline delimited list of partial file names. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
!!! example
In a Compose file:
```yaml
MODRINTH_FORCE_INCLUDE_FILES: |
yet-another-config-lib
```
## Default exclude/includes
The image comes with a default set of exclude/includes, maintained [in the repo files area](https://github.com/itzg/docker-minecraft-server/blob/master/files/modrinth-exclude-include.json) and uses the same [JSON schema](https://github.com/itzg/mc-image-helper?tab=readme-ov-file#excludeinclude-file-schema) as Auto CurseForge. Those defaults can be disabled by setting the env var `MODRINTH_DEFAULT_EXCLUDE_INCLUDES` to an empty string.
## Excluding Overrides Files
Modrinth mrpack/zip files may include an `overrides` subdirectory that contains config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `MODRINTH_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
### Ant-style paths
Ant-style paths can include the following globbing/wildcard symbols:
| Symbol | Behavior |
|--------|---------------------------------------------------------|
| `*` | Matches zero, one, or many characters except a slash |
| `**` | Matches zero, one, or many characters including slashes |
| `?` | Matches one character |
!!! example
The following compose `environment` entries show how to exclude Iris and Sodium mods from the overrides
```yaml
MODRINTH_OVERRIDES_EXCLUSIONS: mods/NekosEnchantedBooks-*.jar,mods/citresewn-*.jar
```
or using newline delimiter, which improves maintainability
```yaml
MODRINTH_OVERRIDES_EXCLUSIONS: |
mods/NekosEnchantedBooks-*.jar
mods/citresewn-*.jar
```

View File

@@ -4,8 +4,8 @@ A [Fabric server](https://fabricmc.net/) can be automatically downloaded, upgrad
Using `docker run` command line
```
docker run -d -e EULA=TRUE -e TYPE=FABRIC -p 25565:25565 itzg/minecraft-server
```shell
docker run -d --pull=always -e EULA=TRUE -e TYPE=FABRIC -p 25565:25565 itzg/minecraft-server
```
In a compose file service:
@@ -24,7 +24,7 @@ A specific loader or launcher version other than the latest can be requested usi
With docker run
```
```shell
docker run -d ... \
-e TYPE=FABRIC \
-e FABRIC_LAUNCHER_VERSION=0.10.2 \

View File

@@ -10,7 +10,7 @@ A [Forge server](http://www.minecraftforge.net/) can be automatically downloaded
!!! example
```
```shell
docker run -e TYPE=FORGE ...
```
@@ -25,7 +25,7 @@ The overall version is specified by `VERSION`, [as described in the section abov
!!! example
```
```shell
docker run -e TYPE=FORGE -e VERSION=1.12.2 -e FORGE_VERSION=14.23.5.2854 ...
```
@@ -58,7 +58,7 @@ Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge serv
!!! example
```
```shell
docker run -e TYPE=NEOFORGE -e VERSION=1.20.1 -e NEOFORGE_VERSION=47.1.79 ...
```

View File

@@ -77,14 +77,6 @@ By default the latest build will be used; however, a specific build number can b
-e VERSION=1.16.5 -e MOHIST_BUILD=374
### Catserver
A [Catserver](http://catserver.moe/) type server can be used with
-e TYPE=CATSERVER
> **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored
### Arclight
A [Arclight](https://arclight.izzel.io/) type server can be used with

View File

@@ -9,7 +9,7 @@ If you want to run a specific version, you can add `-e SPONGEVERSION=1.11.2-6.1.
Beware that current [Sponge](https://www.spongepowered.org) `STABLE` versions for Minecraft 1.12 require using [the Java 8 tag](../../versions/java.md):
``` shell
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
docker run -d --pull=always -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server:java8-multiarch
```
@@ -17,7 +17,7 @@ You can also choose to use the `EXPERIMENTAL` branch.
Just change it with `SPONGEBRANCH`, such as:
``` shell
$ docker run -d -v /path/on/host:/data ... \
$ docker run -d --pull=always -v /path/on/host:/data ... \
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
```

View File

@@ -8,7 +8,7 @@ To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "exper
Using `docker run` command line
```
```shell
docker run ... -e TYPE=PAPER ...
docker run ... -e TYPE=PAPER -e VERSION=1.20.6 ...
@@ -112,9 +112,9 @@ By default, the container will run the latest experimental build of [Folia serve
Using `docker run`
```
docker run -d -v /path/on/host:/data \
-e TYPE=FOLIA \
```shell
docker run -d --pull=always \
-v /path/on/host:/data -e TYPE=FOLIA \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```

View File

@@ -1,8 +1,8 @@
Enable [Quilt server](https://quiltmc.org/) mode by adding a `-e TYPE=QUILT` to your command-line.
```
docker run -d -v /path/on/host:/data \
-e TYPE=QUILT \
```shell
docker run -d --pull=always \
-v /path/on/host:/data -e TYPE=QUILT \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
@@ -10,9 +10,9 @@ By default, the container will install the latest [quilt server launcher](https:
A specific loader or installer version other than the latest can be requested using `QUILT_LOADER_VERSION` and `QUILT_INSTALLER_VERSION` respectively, such as:
```
docker run -d -v /path/on/host:/data ... \
-e TYPE=QUILT \
```shell
docker run -d --pull=always \
-v /path/on/host:/data ... -e TYPE=QUILT \
-e QUILT_LOADER_VERSION=0.16.0 \
-e QUILT_INSTALLER_VERSION=0.4.1
```

View File

@@ -747,7 +747,7 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<td>A path to a file inside of container that contains <strong>YOUR</strong> CurseForge (Eternal) API Key.</td>
<td><code></code></td>
<td>✅</td>
</tr>
</tr>
<tr>
<td><code>CF_PAGE_URL</code></td>
<td>Pass a page URL to the modpack or a specific file</td>
@@ -818,6 +818,12 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_MOD_LOADER_VERSION</code></td>
<td>Override the mod loader version declared by the modpack</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>

View File

@@ -15,6 +15,7 @@ where `<tag>` refers to the first column of this table:
| latest | 21 | Ubuntu | Hotspot | amd64, arm64 | |
| stable | 21 | Ubuntu | Hotspot | amd64, arm64 | |
| java25 | 25 | Ubuntu | Hotspot | amd64, arm64 | |
| java25-jdk | 25 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
| java25-graalvm | 25 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | |
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
@@ -22,16 +23,15 @@ where `<tag>` refers to the first column of this table:
| java21-graalvm | 21 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
| java17-graalvm | 17 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) | |
| java16 | 16 | Ubuntu | Hotspot | amd64, arm64, armv7 | (4) |
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
Notes
1. Why no arm64 for Java 17 Alpine? That is because the base images, such as [elipse-temurin](https://hub.docker.com/_/eclipse-temurin/tags?page=&page_size=&ordering=&name=17-jre-alpine) do not provide support for that. Use the Ubuntu based images instead.
1. Why no arm64 for Java 17 Alpine? That is because the base images, such as [elipse-temurin](https://hub.docker.com/_/eclipse-temurin/tags?page=&page_size=&ordering=&name=17-jre-alpine) do not provide support for that. Use the Ubuntu-based images instead.
2. Short-term variant, subject to deprecation upon next version introduction
3. Based on the [Oracle GraalMV images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise.
3. Based on the [Oracle GraalVM images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise.
4. This version of Java is [recommended for PaperMC 1.16.5](https://docs.papermc.io/paper/getting-started/#requirements)
!!! example "Example using java8"
@@ -134,6 +134,7 @@ The following image tags have been deprecated and are no longer receiving update
- java16-openj9
- java17-graalvm-ce
- java17-openj9
- java17-alpine
- java19
- java20-graalvm, java20, java20-alpine
- java23-*
@@ -143,4 +144,4 @@ The following image tags have been deprecated and are no longer receiving update
## JSON Listing
Information about the image tags is available programmatically at <https://raw.githubusercontent.com/itzg/docker-minecraft-server/refs/heads/master/images.json>
Information about the image tags is available for programmatic access at <https://raw.githubusercontent.com/itzg/docker-minecraft-server/refs/heads/master/images.json>

View File

@@ -0,0 +1,19 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "TRUE"
TYPE: PAPER
MAX_MEMORY: 4G
MODRINTH_PROJECTS: |
luckperms
APPLY_EXTRA_FILES: |
plugins/LuckPerms</shared-configs/LuckPerms/
DEBUG: true
volumes:
- data:/data
- ./shared-configs:/shared-configs:ro
ports:
- "25565:25565"
volumes:
data:

View File

@@ -0,0 +1,753 @@
####################################################################################################
# LOCALLY MODIFIED
####################################################################################################
# +----------------------------------------------------------------------------------------------+ #
# | __ __ ___ __ __ | #
# | | | | / ` |__/ |__) |__ |__) |\/| /__` | #
# | |___ \__/ \__, | \ | |___ | \ | | .__/ | #
# | | #
# | https://luckperms.net | #
# | | #
# | WIKI: https://luckperms.net/wiki | #
# | DISCORD: https://discord.gg/luckperms | #
# | BUG REPORTS: https://github.com/LuckPerms/LuckPerms/issues | #
# | | #
# | Each option in this file is documented and explained here: | #
# | ==> https://luckperms.net/wiki/Configuration | #
# | | #
# | New options are not added to this file automatically. Default values are used if an | #
# | option cannot be found. The latest config versions can be obtained at the link above. | #
# +----------------------------------------------------------------------------------------------+ #
####################################################################################################
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | ESSENTIAL SETTINGS | #
# | | #
# | Important settings that control how LuckPerms functions. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# The name of the server, used for server specific permissions.
#
# - When set to "global" this setting is effectively ignored.
# - In all other cases, the value here is added to all players in a "server" context.
# - See: https://luckperms.net/wiki/Context
server: global
# If the servers own UUID cache/lookup facility should be used when there is no record for a player
# already in LuckPerms.
#
# - When this is set to 'false', commands using a player's username will not work unless the player
# has joined since LuckPerms was first installed.
# - To get around this, you can use a player's uuid directly in the command, or enable this option.
# - When this is set to 'true', the server facility is used. This may use a number of methods,
# including checking the servers local cache, or making a request to the Mojang API.
use-server-uuid-cache: false
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | STORAGE SETTINGS | #
# | | #
# | Controls which storage method LuckPerms will use to store data. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# How the plugin should store data
#
# - The various options are explained in more detail on the wiki:
# https://luckperms.net/wiki/Storage-types
#
# - Possible options:
#
# | Remote databases - require connection information to be configured below
# |=> MySQL
# |=> MariaDB (preferred over MySQL)
# |=> PostgreSQL
# |=> MongoDB
#
# | Flatfile/local database - don't require any extra configuration
# |=> H2 (preferred over SQLite)
# |=> SQLite
#
# | Readable & editable text files - don't require any extra configuration
# |=> YAML (.yml files)
# |=> JSON (.json files)
# |=> HOCON (.conf files)
# |=> TOML (.toml files)
# |
# | By default, user, group and track data is separated into different files. Data can be combined
# | and all stored in the same file by switching to a combined storage variant.
# | Just add '-combined' to the end of the storage-method, e.g. 'yaml-combined'
#
# - A H2 database is the default option.
# - If you want to edit data manually in "traditional" storage files, we suggest using YAML.
storage-method: h2
# The following block defines the settings for remote database storage methods.
#
# - You don't need to touch any of the settings here if you're using a local storage method!
# - The connection detail options are shared between all remote storage types.
data:
# Define the address and port for the database.
# - The standard DB engine port is used by default
# (MySQL: 3306, PostgreSQL: 5432, MongoDB: 27017)
# - Specify as "host:port" if differs
address: localhost
# The name of the database to store LuckPerms data in.
# - This must be created already. Don't worry about this setting if you're using MongoDB.
database: minecraft
# Credentials for the database.
username: root
password: ''
# These settings apply to the MySQL connection pool.
# - The default values will be suitable for the majority of users.
# - Do not change these settings unless you know what you're doing!
pool-settings:
# Sets the maximum size of the MySQL connection pool.
# - Basically this value will determine the maximum number of actual
# connections to the database backend.
# - More information about determining the size of connection pools can be found here:
# https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
maximum-pool-size: 10
# Sets the minimum number of idle connections that the pool will try to maintain.
# - For maximum performance and responsiveness to spike demands, it is recommended to not set
# this value and instead allow the pool to act as a fixed size connection pool.
# (set this value to the same as 'maximum-pool-size')
minimum-idle: 10
# This setting controls the maximum lifetime of a connection in the pool in milliseconds.
# - The value should be at least 30 seconds less than any database or infrastructure imposed
# connection time limit.
maximum-lifetime: 1800000 # 30 minutes
# This setting controls how frequently the pool will 'ping' a connection in order to prevent it
# from being timed out by the database or network infrastructure, measured in milliseconds.
# - The value should be less than maximum-lifetime and greater than 30000 (30 seconds).
# - Setting the value to zero will disable the keepalive functionality.
keepalive-time: 0
# This setting controls the maximum number of milliseconds that the plugin will wait for a
# connection from the pool, before timing out.
connection-timeout: 5000 # 5 seconds
# This setting allows you to define extra properties for connections.
#
# By default, the following options are set to enable utf8 encoding. (you may need to remove
# these if you are using PostgreSQL)
# useUnicode: true
# characterEncoding: utf8
#
# You can also use this section to disable SSL connections, by uncommenting the 'useSSL' and
# 'verifyServerCertificate' options below.
properties:
useUnicode: true
characterEncoding: utf8
#useSSL: false
#verifyServerCertificate: false
# The prefix for all LuckPerms SQL tables.
#
# - This only applies for remote SQL storage types (MySQL, MariaDB, etc).
# - Change this if you want to use different tables for different servers.
table-prefix: 'luckperms_'
# The prefix to use for all LuckPerms MongoDB collections.
#
# - This only applies for the MongoDB storage type.
# - Change this if you want to use different collections for different servers. The default is no
# prefix.
mongodb-collection-prefix: ''
# The connection string URI to use to connect to the MongoDB instance.
#
# - When configured, this setting will override anything defined in the address, database,
# username or password fields above.
# - If you have a connection string that starts with 'mongodb://' or 'mongodb+srv://', enter it
# below.
# - For more information, please see https://docs.mongodb.com/manual/reference/connection-string/
mongodb-connection-uri: ''
# Define settings for a "split" storage setup.
#
# - This allows you to define a storage method for each type of data.
# - The connection options above still have to be correct for each type here.
split-storage:
# Don't touch this if you don't want to use split storage!
enabled: false
methods:
# These options don't need to be modified if split storage isn't enabled.
user: h2
group: h2
track: h2
uuid: h2
log: h2
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | UPDATE PROPAGATION & MESSAGING SERVICE | #
# | | #
# | Controls the ways in which LuckPerms will sync data & notify other servers of changes. | #
# | These options are documented on greater detail on the wiki under "Instant Updates". | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# This option controls how frequently LuckPerms will perform a sync task.
#
# - A sync task will refresh all data from the storage, and ensure that the most up-to-date data is
# being used by the plugin.
# - This is disabled by default, as most users will not need it. However, if you're using a remote
# storage type without a messaging service setup, you may wish to set this to something like 3.
# - Set to -1 to disable the task completely.
sync-minutes: -1
# If the file watcher should be enabled.
#
# - When using a file-based storage type, LuckPerms can monitor the data files for changes, and
# automatically update when changes are detected.
# - If you don't want this feature to be active, set this option to false.
watch-files: true
# Define which messaging service should be used by the plugin.
#
# - If enabled and configured, LuckPerms will use the messaging service to inform other connected
# servers of changes.
# - Use the command "/lp networksync" to manually push changes.
# - Data is NOT stored using this service. It is only used as a messaging platform.
#
# - If you decide to enable this feature, you should set "sync-minutes" to -1, as there is no need
# for LuckPerms to poll the database for changes.
#
# - Possible options:
# => sql Uses the SQL database to form a queue system for communication. Will only work when
# 'storage-method' is set to MySQL or MariaDB. This is chosen by default if the
# option is set to 'auto' and SQL storage is in use. Set to 'notsql' to disable this.
# => pluginmsg Uses the plugin messaging channels to communicate with the proxy.
# LuckPerms must be installed on your proxy & all connected servers backend servers.
# Won't work if you have more than one proxy.
# => lilypad Uses LilyPad pub-sub to push changes. You need to have the LilyPad-Connect plugin
# installed.
# => redis Uses Redis pub-sub to push changes. Your server connection info must be configured
# below.
# => rabbitmq Uses RabbitMQ pub-sub to push changes. Your server connection info must be
# configured below.
# => nats Uses Nats pub-sub to push changes. Your server connection info must be
# configured below.
# => custom Uses a messaging service provided using the LuckPerms API.
# => auto Attempts to automatically setup a messaging service using redis or sql.
messaging-service: auto
# If LuckPerms should automatically push updates after a change has been made with a command.
auto-push-updates: true
# If LuckPerms should push logging entries to connected servers via the messaging service.
push-log-entries: true
# If LuckPerms should broadcast received logging entries to players on this platform.
#
# - If you have LuckPerms installed on your backend servers as well as a BungeeCord proxy, you
# should set this option to false on either your backends or your proxies, to avoid players being
# messaged twice about log entries.
broadcast-received-log-entries: true
# Settings for Redis.
# Port 6379 is used by default; set address to "host:port" if differs
# Multiple Redis nodes can be specified in the same format as a string list under the name "addresses".
redis:
enabled: false
address: localhost
username: ''
password: ''
# Settings for Nats.
# Port 4222 is used by default; set address to "host:port" if differs
nats:
enabled: false
address: localhost
username: ''
password: ''
# Settings for RabbitMQ.
# Port 5672 is used by default; set address to "host:port" if differs
rabbitmq:
enabled: false
address: localhost
vhost: '/'
username: 'guest'
password: 'guest'
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | CUSTOMIZATION SETTINGS | #
# | | #
# | Settings that allow admins to customize the way LuckPerms operates. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# Controls how temporary permissions/parents/meta should be accumulated.
#
# - The default behaviour is "deny".
# - This behaviour can also be specified when the command is executed. See the command usage
# documentation for more info.
#
# - Possible options:
# => accumulate durations will be added to the existing expiry time
# => replace durations will be replaced if the new duration is later than the current
# expiration
# => deny the command will just fail if you try to add another node with the same expiry
temporary-add-behaviour: deny
# Controls how LuckPerms will determine a users "primary" group.
#
# - The meaning and influence of "primary groups" are explained in detail on the wiki.
# - The preferred approach is to let LuckPerms automatically determine a users primary group
# based on the relative weight of their parent groups.
#
# - Possible options:
# => stored use the value stored against the users record in the file/database
# => parents-by-weight just use the users most highly weighted parent
# => all-parents-by-weight same as above, but calculates based upon all parents inherited from
# both directly and indirectly
primary-group-calculation: parents-by-weight
# If the plugin should check for "extra" permissions with users run LP commands.
#
# - These extra permissions allow finer control over what users can do with each command, and who
# they have access to edit.
# - The nature of the checks are documented on the wiki under "Argument based command permissions".
# - Argument based permissions are *not* static, unlike the 'base' permissions, and will depend upon
# the arguments given within the command.
argument-based-command-permissions: false
# If the plugin should check whether senders are a member of a given group before they're able to
# edit the groups data or add/remove other users to/from it.
# Note: these limitations do not apply to the web editor!
require-sender-group-membership-to-modify: false
# If the plugin should send log notifications to users whenever permissions are modified.
#
# - Notifications are only sent to those with the appropriate permission to receive them
# - They can also be temporarily enabled/disabled on a per-user basis using
# '/lp log notify <on|off>'
log-notify: true
# Defines a list of log entries which should not be sent as notifications to users.
#
# - Each entry in the list is a RegEx expression which is matched against the log entry description.
log-notify-filtered-descriptions:
# - "parent add example"
# If LuckPerms should automatically install translation bundles and periodically update them.
auto-install-translations: true
# Defines the options for prefix and suffix stacking.
#
# - The feature allows you to display multiple prefixes or suffixes alongside a players username in
# chat.
# - It is explained and documented in more detail on the wiki under "Prefix & Suffix Stacking".
#
# - The options are divided into separate sections for prefixes and suffixes.
# - The 'duplicates' setting refers to how duplicate elements are handled. Can be 'retain-all',
# 'first-only' or 'last-only'.
# - The value of 'start-spacer' is included at the start of the resultant prefix/suffix.
# - The value of 'end-spacer' is included at the end of the resultant prefix/suffix.
# - The value of 'middle-spacer' is included between each element in the resultant prefix/suffix.
#
# - Possible format options:
# => highest Selects the value with the highest weight, from all values
# held by or inherited by the player.
#
# => lowest Same as above, except takes the one with the lowest weight.
#
# => highest_own Selects the value with the highest weight, but will not
# accept any inherited values.
#
# => lowest_own Same as above, except takes the value with the lowest weight.
#
# => highest_inherited Selects the value with the highest weight, but will only
# accept inherited values.
#
# => lowest_inherited Same as above, except takes the value with the lowest weight.
#
# => highest_on_track_<track> Selects the value with the highest weight, but only if the
# value was inherited from a group on the given track.
#
# => lowest_on_track_<track> Same as above, except takes the value with the lowest weight.
#
# => highest_not_on_track_<track> Selects the value with the highest weight, but only if the
# value was inherited from a group not on the given track.
#
# => lowest_not_on_track_<track> Same as above, except takes the value with the lowest weight.
#
# => highest_from_group_<group> Selects the value with the highest weight, but only if the
# value was inherited from the given group.
#
# => lowest_from_group_<group> Same as above, except takes the value with the lowest weight.
#
# => highest_not_from_group_<group> Selects the value with the highest weight, but only if the
# value was not inherited from the given group.
#
# => lowest_not_from_group_<group> Same as above, except takes the value with the lowest weight.
meta-formatting:
prefix:
format:
- "highest"
duplicates: first-only
start-spacer: ""
middle-spacer: " "
end-spacer: ""
suffix:
format:
- "highest"
duplicates: first-only
start-spacer: ""
middle-spacer: " "
end-spacer: ""
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | PERMISSION CALCULATION AND INHERITANCE | #
# | | #
# | Modify the way permission checks, meta lookups and inheritance resolutions are handled. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# The algorithm LuckPerms should use when traversing the "inheritance tree".
#
# - Possible options:
# => breadth-first See: https://en.wikipedia.org/wiki/Breadth-first_search
# => depth-first-pre-order See: https://en.wikipedia.org/wiki/Depth-first_search
# => depth-first-post-order See: https://en.wikipedia.org/wiki/Depth-first_search
inheritance-traversal-algorithm: depth-first-pre-order
# If a final sort according to "inheritance rules" should be performed after the traversal algorithm
# has resolved the inheritance tree.
#
# "Inheritance rules" refers to things such as group weightings, primary group status, and the
# natural contextual ordering of the group nodes.
#
# Setting this to 'true' will allow for the inheritance rules to take priority over the structure of
# the inheritance tree.
#
# Effectively when this setting is 'true': the tree is flattened, and rules applied afterwards,
# and when this setting is 'false':, the rules are just applied during each step of the traversal.
post-traversal-inheritance-sort: false
# Defines the mode used to determine whether a set of contexts are satisfied.
#
# - Possible options:
# => at-least-one-value-per-key Set A will be satisfied by another set B, if at least one of the
# key-value entries per key in A are also in B.
# => all-values-per-key Set A will be satisfied by another set B, if all key-value
# entries in A are also in B.
context-satisfy-mode: at-least-one-value-per-key
# LuckPerms has a number of built-in contexts. These can be disabled by adding the context key to
# the list below.
disabled-contexts:
# - "world"
# +----------------------------------------------------------------------------------------------+ #
# | Permission resolution settings | #
# +----------------------------------------------------------------------------------------------+ #
# If users on this server should have their global permissions applied.
# When set to false, only server specific permissions will apply for users on this server
include-global: true
# If users on this server should have their global world permissions applied.
# When set to false, only world specific permissions will apply for users on this server
include-global-world: true
# If users on this server should have global (non-server specific) groups applied
apply-global-groups: true
# If users on this server should have global (non-world specific) groups applied
apply-global-world-groups: true
# +----------------------------------------------------------------------------------------------+ #
# | Meta lookup settings | #
# +----------------------------------------------------------------------------------------------+ #
# Defines how meta values should be selected.
#
# - Possible options:
# => inheritance Selects the meta value that was inherited first
# => highest-number Selects the highest numerical meta value
# => lowest-number Selects the lowest numerical meta value
meta-value-selection-default: inheritance
# Defines how meta values should be selected per key.
meta-value-selection:
# max-homes: highest-number
# +----------------------------------------------------------------------------------------------+ #
# | Inheritance settings | #
# +----------------------------------------------------------------------------------------------+ #
# If the plugin should apply wildcard permissions.
#
# - If set to true, LuckPerms will detect wildcard permissions, and resolve & apply all registered
# permissions matching the wildcard.
apply-wildcards: true
# If LuckPerms should resolve and apply permissions according to the Sponge style implicit wildcard
# inheritance system.
#
# - That being: If a user has been granted "example", then the player should have also be
# automatically granted "example.function", "example.another", "example.deeper.nesting",
# and so on.
apply-sponge-implicit-wildcards: false
# If the plugin should apply negated Bukkit default permissions before it considers wildcard
# assignments.
#
# - Plugin authors can define permissions which explicitly should not be given automatically to OPs.
# This is usually used for so called "anti-permissions" - permissions which, when granted, apply
# something negative.
# - If this option is set to true, LuckPerms will consider any negated declarations made by
# plugins before it considers wildcards. (similar to the way the OP system works)
# - If this option is set to false, LuckPerms will consider any wildcard assignments first.
apply-default-negated-permissions-before-wildcards: false
# If the plugin should parse regex permissions.
#
# - If set to true, LuckPerms will detect regex permissions, marked with "r=" at the start of the
# node, and resolve & apply all registered permissions matching the regex.
apply-regex: true
# If the plugin should complete and apply shorthand permissions.
#
# - If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand: true
# If the plugin should apply Bukkit child permissions.
#
# - Plugin authors can define custom permissions structures for their plugin, which will be resolved
# and used by LuckPerms if this setting is enabled.
apply-bukkit-child-permissions: true
# If the plugin should apply Bukkit default permissions.
#
# - Plugin authors can define permissions which should be given to all users by default, or setup
# permissions which should/shouldn't be given to opped players.
# - If this option is set to false, LuckPerms will ignore these defaults.
apply-bukkit-default-permissions: true
# If the plugin should apply attachment permissions.
#
# - Other plugins on the server are able to add their own "permission attachments" to players.
# - This allows them to grant players additional permissions which last until the end of the
# session, or until they're removed.
# - If this option is set to false, LuckPerms will not include these attachment permissions when
# considering if a player should have access to a certain permission.
apply-bukkit-attachment-permissions: true
# +----------------------------------------------------------------------------------------------+ #
# | Extra settings | #
# +----------------------------------------------------------------------------------------------+ #
# A list of context calculators which will be skipped when calculating contexts.
#
# - You can disable context calculators by either:
# => specifying the Java class name used by the calculator (e.g. com.example.ExampleCalculator)
# => specifying a sub-section of the Java package used by the calculator (e.g. com.example)
disabled-context-calculators: []
# Allows you to set "aliases" for the worlds sent forward for context calculation.
#
# - These aliases are provided in addition to the real world name. Applied recursively.
# - Remove the comment characters for the default aliases to apply.
world-rewrite:
# world_nether: world
# world_the_end: world
# Define special group weights for this server.
#
# - Group weights can also be applied directly to group data, using the setweight command.
# - This section allows weights to be set on a per-server basis.
group-weight:
# admin: 10
# +----------------------------------------------------------------------------------------------+ #
# | | #
# | FINE TUNING OPTIONS | #
# | | #
# | A number of more niche settings for tweaking and changing behaviour. The section also | #
# | contains toggles for some more specialised features. It is only necessary to make changes to | #
# | these options if you want to fine-tune LuckPerms behaviour. | #
# | | #
# +----------------------------------------------------------------------------------------------+ #
# +----------------------------------------------------------------------------------------------+ #
# | Server Operator (OP) settings | #
# +----------------------------------------------------------------------------------------------+ #
# Controls whether server operators should exist at all.
#
# - When set to 'false', all players will be de-opped, and the /op and /deop commands will be
# disabled. Note that vanilla features like the spawn-protection require an operator on the
# server to work.
enable-ops: true
# Enables or disables a special permission based system in LuckPerms for controlling OP status.
#
# - If set to true, any user with the permission "luckperms.autoop" will automatically be granted
# server operator status. This permission can be inherited, or set on specific servers/worlds,
# temporarily, etc.
# - Additionally, setting this to true will force the "enable-ops" option above to false. All users
# will be de-opped unless they have the permission node, and the op/deop commands will be
# disabled.
# - It is recommended that you use this option instead of assigning a single '*' permission.
auto-op: false
# Defines if "opped" players should be able to use all LuckPerms commands by default.
#
# - Set to false to only allow users who have the permissions access to the commands
commands-allow-op: true
# +----------------------------------------------------------------------------------------------+ #
# | Vault integration settings | #
# +----------------------------------------------------------------------------------------------+ #
# If Vault lookups for offline players on the main server thread should be enabled.
#
# LuckPerms has a "catch" for plugins attempting to perform unsafe offline player data lookups
# from the main server thread. This catch raises an exception (causes an error to occur) when unsafe
# lookups are made, instead of allowing the lookup to happen, which would likely cause the server
# to lag.
#
# However, if you're willing to accept the consequences, the catch can be disabled by setting this
# option to 'true.
vault-unsafe-lookups: false
# If LuckPerms should use the 'display name' of a group when returning groups in Vault API calls.
#
# - When this option is set to true, the display name of the group is returned.
# - When this option is set to false, the standard name/id of the group is returned.
vault-group-use-displaynames: true
# Controls which group LuckPerms should use for NPC players when handling Vault requests.
#
# - As NPCs aren't actually real players, LuckPerms does not load any user data for them. This
# becomes an issue when plugins want to check for their permissions using Vault.
# - As a solution, Vault checks for NPCs fallback to a group, which is defined below.
vault-npc-group: default
# Controls how LuckPerms should consider the OP status of NPC players when handing Vault requests.
#
# - If you want NPCs to have the same permissions as "normal" players, set this option to false.
# - If you want NPCs to have OP status, set this option to true.
vault-npc-op-status: false
# If the vault-server option below should be used.
#
# - When this option is set to false, the server value defined above under "server" is used.
use-vault-server: false
# The name of the server used within Vault operations.
#
# - If you don't want Vault operations to be server specific, set this to "global".
# - Will only take effect if use-vault-server is set to true above.
vault-server: global
# If global permissions should be considered when retrieving meta or player groups
vault-include-global: true
# If Vault operations should ignore any world arguments if supplied.
vault-ignore-world: false
# +----------------------------------------------------------------------------------------------+ #
# | Miscellaneous (and rarely used) settings | #
# +----------------------------------------------------------------------------------------------+ #
# If LuckPerms should produce extra logging output when it handles logins.
#
# - Useful if you're having issues with UUID forwarding or data not being loaded.
debug-logins: false
# If LuckPerms should allow usernames with non alphanumeric characters.
#
# - Note that due to the design of the storage implementation, usernames must still be 16 characters
# or less.
allow-invalid-usernames: false
# If LuckPerms should not require users to confirm bulkupdate operations.
#
# - When set to true, operations will be executed immediately.
# - This is not recommended, as bulkupdate has the potential to irreversibly delete large amounts of
# data, and is not designed to be executed automatically.
# - If automation is needed, users should prefer using the LuckPerms API.
skip-bulkupdate-confirmation: false
# If LuckPerms should prevent bulkupdate operations.
#
# - When set to true, bulkupdate operations (the /lp bulkupdate command) will not work.
# - When set to false, bulkupdate operations will be allowed via the console.
disable-bulkupdate: false
# If LuckPerms should allow a users primary group to be removed with the 'parent remove' command.
#
# - When this happens, the plugin will set their primary group back to default.
prevent-primary-group-removal: false
# If LuckPerms should update the list of commands sent to the client when permissions are changed.
update-client-command-list: true
# If LuckPerms should attempt to register "Brigadier" command list data for its commands.
register-command-list-data: true
# If LuckPerms should attempt to resolve Vanilla command target selectors for LP commands.
# See here for more info: https://minecraft.wiki/w/Target_selectors
resolve-command-selectors: false
# If the plugin should run in "read-only" mode for commands.
#
# In this mode, players or the console will only be able to execute commands that read or view
# data, and will not be able to execute any LP commands that modify data.
#
# If enabling read-only mode for just players, be aware that some other plugins may allow players
# to execute commands as the console, allowing them to run LP commands indirectly.
#
# Note: This does not affect interactions with LuckPerms via the API.
commands-read-only-mode:
players: false
console: false
# If LuckPerms commands should be disabled. When true, this will prevent all LP commands from being
# executed. In a sense this is a more extreme version of read-only mode (see above).
#
# LuckPerms will still act as the permission manager, but server administrators will be unable to
# make changes via commands.
#
# If disabling commands just for players, be aware that some other plugins may allow players to
# execute commands as the console, allowing them to run commands indirectly.
#
# If commands are disabled for both players and the console, LuckPerms will not attempt to register
# a command with the server at all & in a sense will be invisible to both players and admins.
#
# Note: This does not affect interactions with LuckPerms via the API.
disable-luckperms-commands:
players: false
console: false

View File

@@ -18,6 +18,7 @@ services:
# CF_FILENAME_MATCHER: "1.17"
MEMORY: 4G
CF_OVERRIDES_EXCLUSIONS: |
# Not applicable for server side
shaderpacks/**
volumes:
# Use managed volume by default, but can change to a relative path like

View File

@@ -0,0 +1,22 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "TRUE"
MODPACK_PLATFORM: AUTO_CURSEFORGE
# Allocate API key from https://console.curseforge.com/
CF_API_KEY: ${CF_API_KEY}
# Example of overriding modloader version for a Fabric modpack
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
CF_SLUG: "cobblemon-fabric"
# Override the mod loader version from the modpack
CF_MOD_LOADER_VERSION: "0.16.14"
MEMORY: "4G"
ports:
- "25565:25565"
volumes:
- ./data:/data
stdin_open: true
tty: true
# See https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#custom-modloader-versions

View File

@@ -16,6 +16,7 @@ services:
# Optional: select a specific version/file
#CF_FILENAME_MATCHER: "0.2.34"
CF_EXCLUDE_MODS: |
# Exclude client-side mods not published correctly
creative-core
default-options
itemphysic-lite
@@ -25,6 +26,7 @@ services:
MEMORY: 4G
volumes:
- mc-data:/data
- C:\Users\geoff\git\mc-image-helper\build\install\mc-image-helper:/usr/share/mc-image-helper:ro
volumes:
mc-data: {}

View File

@@ -1,24 +1,24 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
# https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/
MODPACK_PLATFORM: AUTO_CURSEFORGE
# CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/skyfactory-5/files/6290684
CF_SLUG: skyfactory-5
# Comment out the following to get the latest version or pick a version from
# https://www.curseforge.com/minecraft/modpacks/skyfactory-5/files/all?page=1&pageSize=20
CF_FILENAME_MATCHER: 5.0.8
# Allocate API key from https://console.curseforge.com/
# and set in .env file making sure to double up dollar signs, such as
# CF_API_KEY=$$2a$$10$$....
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
CF_API_KEY: ${CF_API_KEY}
MEMORY: 4G
ports:
- "25565:25565"
volumes:
- mc-data:/data
volumes:
mc-data:
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
# https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/
MODPACK_PLATFORM: AUTO_CURSEFORGE
# CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/skyfactory-5/files/6290684
CF_SLUG: skyfactory-5
# Comment out the following to get the latest version or pick a version from
# https://www.curseforge.com/minecraft/modpacks/skyfactory-5/files/all?page=1&pageSize=20
CF_FILENAME_MATCHER: 5.0.8
# Allocate API key from https://console.curseforge.com/
# and set in .env file making sure to double up dollar signs, such as
# CF_API_KEY=$$2a$$10$$....
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
CF_API_KEY: ${CF_API_KEY}
MEMORY: 4G
ports:
- "25565:25565"
volumes:
- mc-data:/data
volumes:
mc-data:

View File

@@ -0,0 +1,22 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "TRUE"
TYPE: PAPER
DEBUG: true
PLUGINS: |
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
https://hangarcdn.papermc.io/plugins/BentoboxWorld/bentobox/versions/3.7.4/PAPER/BentoBox-3.7.4.jar
DOWNLOAD_EXTRA_CONFIGS: |
# Even though it's a jar can be treated just like any other file
plugins/BentoBox/addons<https://github.com/BentoBoxWorld/AOneBlock/releases/download/1.20.0/AOneBlock-1.20.0.jar
ports:
- "25565:25565"
- "25565:25565/udp"
- "19132:19132/udp"
volumes:
- data:/data
volumes:
data:

View File

@@ -1,18 +1,19 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: FORGE
# Allocate API key from https://console.curseforge.com/
# and set in .env file making sure to double up dollar signs, such as
# CF_API_KEY=$$2a$$10$$....
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
CF_API_KEY: ${CF_API_KEY}
VERSION: 1.19.2
CURSEFORGE_FILES: |
geckolib
aquaculture
naturalist
ports:
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: FORGE
# Allocate API key from https://console.curseforge.com/
# and set in .env file making sure to double up dollar signs, such as
# CF_API_KEY=$$2a$$10$$....
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
CF_API_KEY: ${CF_API_KEY}
VERSION: 1.19.2
CURSEFORGE_FILES: |
geckolib # some comment
# Removing temporarily
#aquaculture
naturalist
ports:
- "25565:25565"

View File

@@ -0,0 +1,25 @@
services:
mc:
# make sure this java version matches with pack java version
image: itzg/minecraft-server:java25
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: GTNH
GTNH_PACK_VERSION: "2.8.1"
# Enable to delete old config backups
# GTNH_DELETE_BACKUPS: true
# Use to prevent updates
# SKIP_GTNH_UPDATE_CHECK: true
MEMORY: 6G
# Bring in standard extra mods described at https://wiki.gtnewhorizons.com/wiki/Additional_Mods
# MODS: |
# https://github.com/Kynake/BetterFoliage/releases/download/1.2.1/BetterFoliage-LegacyEdition-1.2.1.jar
volumes:
# attach a managed volume, change to a relative or absolute host directory if needed
- mc-data:/data
volumes:
mc-data:

View File

@@ -1,7 +1,7 @@
services:
mc:
# make sure this java version matches with pack java version
image: itzg/minecraft-server:java21
image: itzg/minecraft-server:java25
tty: true
stdin_open: true
ports:
@@ -17,7 +17,9 @@ services:
MEMORY: 6G
# Make sure that this matches what is in your pack's startserver bash file
JVM_OPTS: "-Dfml.readTimeout=180 @java9args.txt"
CUSTOM_SERVER: "lwjgl3ify-forgePatches.jar"
# You may choose to instead download a specific jar version yourself, and change this value to the local jar.
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/configuration/misc-options/#running-with-a-custom-server-jar
CUSTOM_SERVER: "https://github.com/GTNewHorizons/lwjgl3ify/releases/download/2.1.16/lwjgl3ify-2.1.16-forgePatches.jar"
# Set server.properties according to GTNH server defaults
MOTD: "GT:New Horizons 2.8.0"
DIFFICULTY: "hard"

View File

@@ -8,14 +8,14 @@ services:
environment:
EULA: "TRUE"
MODPACK_PLATFORM: MODRINTH
MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2
MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric/version/1.6.1.4
# or for auto-upgrading to latest
# MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric
# or just cobblemon-fabric or 5FFgwNNP
# and could replace version URL with
# MODRINTH_VERSION: nvrqJg44
# MODRINTH_VERSION: 1.3.2
# MODRINTH_VERSION: "Cobblemon [Fabric] 1.3.2"
# MODRINTH_VERSION: 98odLiu9
# MODRINTH_VERSION: 1.6.1.4
# MODRINTH_VERSION: "Cobblemon [Fabric] 1.6.1.4"
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -6,6 +6,6 @@ services:
TYPE: PAPER
VERSION: 1.19.3
MODRINTH_PROJECTS: "coreprotect"
MODRINTH_ALLOWED_VERSION_TYPE: "release"
MODRINTH_PROJECTS_DEFAULT_VERSION_TYPE: "release"
volumes:
- ./data:/data

View File

@@ -1,15 +1,15 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: paper
MODRINTH_PROJECTS: |
viaversion
viabackwards
griefprevention
discordsrv
VERSION_FROM_MODRINTH_PROJECTS: true
MEMORY: 2G
ports:
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: paper
MODRINTH_PROJECTS: |
viaversion
viabackwards
griefprevention
discordsrv
VERSION_FROM_MODRINTH_PROJECTS: true
MEMORY: 2G
ports:
- "25565:25565"

View File

@@ -35,6 +35,7 @@
"controllable",
"controlling",
"craftpresence",
"cull-less-leaves",
"ctm",
"custom-main-menu",
"dark-mode-everywhere",
@@ -101,6 +102,7 @@
"make-bubbles-pop",
"menumobs",
"minecraft-rich-presence",
"mining-speed-tooltips",
"model-gap-fix",
"more-overlays",
"mouse-tweaks",
@@ -148,6 +150,7 @@
"sound-filters",
"sound-physics-remastered",
"sound-reloader",
"status-effect-bars-reforged",
"stellar-sky",
"swingthroughgrass",
"textrues-embeddium-options",
@@ -179,6 +182,9 @@
"create-arcane-engineering": {
"forceIncludes": ["just-enough-resources-jer"]
},
"ftb-stoneblock-4": {
"forceIncludes": ["particular-reforged"]
},
"mc-eternal-2": {
"forceIncludes": [
"particular-reforged",

View File

@@ -32,6 +32,7 @@
"continuity",
"controlling",
"craftpresence",
"Cull Less Leaves",
"cwb",
"DisableCustomWorldsAdvice",
"distraction_free_recipes",
@@ -71,6 +72,7 @@
"loadmyresources",
"lootbeams",
"MindfulDarkness",
"miningspeedtooltips",
"MouseTweaks",
"nicer-skies",
"notenoughanimations",

View File

@@ -0,0 +1,12 @@
{
"file": "/data/settings.yml",
"ops": [
{
"$set": {
"path": "$.bind.port",
"value": "${SERVER_PORT}",
"value-type": "int"
}
}
]
}

View File

@@ -28,6 +28,7 @@
"level-seed": {"env": "SEED"},
"level-type": {"env": "LEVEL_TYPE"},
"log-ips": {"env": "LOG_IPS"},
"management-server-allowed-origins": {"env": "MANAGEMENT_SERVER_ALLOWED_ORIGINS"},
"management-server-enabled": {"env": "MANAGEMENT_SERVER_ENABLED"},
"management-server-host": {"env": "MANAGEMENT_SERVER_HOST"},
"management-server-port": {"env": "MANAGEMENT_SERVER_PORT"},

View File

@@ -97,7 +97,8 @@
"java": "17",
"distribution": "alpine",
"jvm": "hotspot",
"architectures": ["amd64", "arm64"]
"architectures": ["amd64", "arm64"],
"deprecated": true
},
{
"tag": "java17-graalvm",

View File

@@ -1,96 +1,95 @@
---
site_name: Minecraft Server on Docker (Java Edition)
site_url: https://docker-minecraft-server.readthedocs.io/en/latest/
site_description: Documentation for Minecraft Server on Docker
repo_url: https://github.com/itzg/docker-minecraft-server
edit_uri: blob/master/docs/
theme:
name: material
features:
- navigation.tracking
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.expand
- navigation.top
- navigation.indexes
locale: en
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
highlightjs: true
hljs_languages:
- yaml
- bash
- java
- docker
- shell
- json
extra_css:
- css/extra.css
markdown_extensions:
- admonition
- toc:
permalink: true
- attr_list
- def_list
- footnotes
- tables
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.snippets
- pymdownx.superfences
- mdx_gh_links:
user: camalot
repo: mkdocs-test
- mkdocs-click
copyright: Copyright &copy; itzg 2024.
plugins:
- search
- autorefs
- mkdocstrings:
handlers:
python:
options:
docstring_section_style: list
members_order: source
show_root_heading: true
show_source: false
show_signature_annotations: true
# https://github.com/ultrabug/mkdocs-static-i18n
- i18n:
languages:
- locale: en
name: English
build: true
default: true
- literate-nav:
nav_file: README.md
implicit_index: true
---
site_name: Minecraft Server on Docker (Java Edition)
site_url: https://docker-minecraft-server.readthedocs.io/en/latest/
site_description: Documentation for Minecraft Server on Docker
repo_url: https://github.com/itzg/docker-minecraft-server
edit_uri: blob/master/docs/
theme:
name: material
features:
- navigation.tracking
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.expand
- navigation.top
- navigation.indexes
locale: en
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
highlightjs: true
hljs_languages:
- yaml
- bash
- java
- docker
- shell
- json
extra_css:
- css/extra.css
markdown_extensions:
- admonition
- toc:
permalink: true
- attr_list
- def_list
- footnotes
- tables
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.snippets
- pymdownx.superfences
- mdx_gh_links:
user: camalot
repo: mkdocs-test
- mkdocs-click
copyright: Copyright &copy; itzg 2025.
plugins:
- search
- autorefs
- mkdocstrings:
handlers:
python:
options:
docstring_section_style: list
members_order: source
show_root_heading: true
show_source: false
show_signature_annotations: true
# https://github.com/ultrabug/mkdocs-static-i18n
- i18n:
languages:
- locale: en
name: English
build: true
default: true
- literate-nav:
nav_file: README.md
implicit_index: true

View File

@@ -48,7 +48,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@"
exec gosu ${runAsUser}:${runAsGroup} "$(dirname "$0")/start-configuration" "$@"
else
exec "$(dirname "$0")/start-configuration" "$@"
fi

View File

@@ -190,7 +190,7 @@ if [[ $MODPACK_PLATFORM && $TYPE && $TYPE != VANILLA ]]; then
fi
case "${TYPE^^}" in
AUTO_CURSEFORGE|MODRINTH|CURSEFORGE|FTB|FTBA)
AUTO_CURSEFORGE|MODRINTH|CURSEFORGE|FTB|FTBA|GTNH)
MODPACK_PLATFORM="$TYPE"
;;
esac
@@ -213,6 +213,10 @@ if [[ $MODPACK_PLATFORM ]]; then
exec "$(dirname "$0")/start-deployModrinth" "$@"
;;
GTNH)
exec "$(dirname "$0")/start-deployGTNH" "$@"
;;
*)
logError "Invalid MODPACK_PLATFORM: '$MODPACK_PLATFORM'"
exit 1
@@ -278,10 +282,6 @@ case "${TYPE^^}" in
exec "$(dirname "$0")/start-deployMohist" "$@"
;;
CATSERVER)
exec "$(dirname "$0")/start-deployCatserver" "$@"
;;
PURPUR)
exec "$(dirname "$0")/start-deployPurpur" "$@"
;;
@@ -321,7 +321,7 @@ case "${TYPE^^}" in
*)
logError "Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER"
exit 1
;;

View File

@@ -14,6 +14,7 @@ set -eu
: "${CF_IGNORE_MISSING_FILES:=}"
: "${CF_EXCLUDE_INCLUDE_FILE=/image/cf-exclude-include.json}"
: "${CF_EXCLUDE_MODS:=}"
: "${CF_EXCLUDE_ALL_MODS:=}"
: "${CF_FORCE_INCLUDE_MODS:=}"
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
@@ -22,6 +23,7 @@ set -eu
: "${CF_MODPACK_MANIFEST:=}"
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
: "${CF_MOD_LOADER_VERSION:=}" # Override mod loader version
resultsFile=/data/.install-curseforge.env
@@ -63,8 +65,10 @@ setArg --overrides-exclusions CF_OVERRIDES_EXCLUSIONS
setArg --ignore-missing-files CF_IGNORE_MISSING_FILES
setArg --api-cache-default-ttl CF_API_CACHE_DEFAULT_TTL
setArg --exclude-mods CF_EXCLUDE_MODS
setArg --exclude-all-mods CF_EXCLUDE_ALL_MODS
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
setArg --mod-loader-version CF_MOD_LOADER_VERSION
setArg --downloads-repo CF_DOWNLOADS_REPO
if ! mc-image-helper install-curseforge "${args[@]}"; then

View File

@@ -28,7 +28,19 @@ function buildSpigotFromSource {
mkdir ${tempDir}
cd ${tempDir}
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
jvmOpts=""
if isPercentage "${INIT_MEMORY:-$MEMORY}"; then
jvmOpts+="-XX:InitialRAMPercentage=$(getPercentageValue "${INIT_MEMORY:-$MEMORY}") "
else
jvmOpts+="-Xms${INIT_MEMORY:-$MEMORY} "
fi
if isPercentage "${MAX_MEMORY:-$MEMORY}"; then
jvmOpts+="-XX:MaxRAMPercentage=$(getPercentageValue "${MAX_MEMORY:-$MEMORY}")"
else
jvmOpts+="-Xmx${MAX_MEMORY:-$MEMORY}"
fi
logn ''
curl -sSL -o ${tempDir}/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \

View File

@@ -1,33 +0,0 @@
#!/bin/bash
# shellcheck source=start-utils
. "$(dirname "$0")/start-utils"
set -o pipefail
set -e
latestAsset=$(
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
jq '.assets[] | select(.name | match(".*-universal.jar"))'
)
if [[ -z "${latestAsset}" ]]; then
logError "Latest release of Catserver is missing universal.jar asset"
exit 1
fi
isDebugging && log "Latest asset ${latestAsset}"
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
export SERVER="/data/${latestJarName}"
if [ ! -f ${SERVER} ]; then
log "Downloading ${latestJarName}"
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
fi
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "$(dirname "$0")/start-spiget" "$@"

281
scripts/start-deployGTNH Normal file
View File

@@ -0,0 +1,281 @@
#!/bin/bash
# shellcheck source=start-utils
. "$(dirname "$0")/start-utils"
# Define setup functions
function getGTNHdownloadPath(){
gtnh_download_path=""
current_java_version=$(mc-image-helper java-release)
if ! mapfile -t packs < <(curl -sfL 'http://downloads.gtnewhorizons.com/ServerPacks/?raw'); then
logError "Failed to retrieve data from http://downloads.gtnewhorizons.com/ServerPacks/?raw"
exit 1
fi
log "Start locating server files..."
for pack in "${packs[@]}"; do
# Extract the Java version(s) from the pack filename
if ! pack_java_version=$(basename "$pack" | grep -Eo 'Java_[0-9]+(-[0-9]+)?' | sed 's/Java_//'); then
logWarning "Could not parse java version of $pack"
fi
# Skip the pack if the current Java version is not compatible
if [[ "$pack_java_version" == *-* ]]; then
# Handle range of Java versions (e.g., "17-21")
java_min_version=$(echo "$pack_java_version" | cut -d'-' -f1)
java_max_version=$(echo "$pack_java_version" | cut -d'-' -f2)
if (( current_java_version < java_min_version || current_java_version > java_max_version )); then
debug "Skipping $pack due to incompatible Java version: $current_java_version not in range $java_min_version-$java_max_version"
continue
fi
else
# Handle single Java version (e.g., "8")
if (( current_java_version != pack_java_version )); then
debug "Skipping $pack due to incompatible Java version: $current_java_version != $pack_java_version"
continue
fi
fi
# Extract version numbers and release type (beta or RC) from the file names
if ! pack_version=$(basename "$pack" | grep -Eo '[0-9]+(\.[0-9]+)+'); then
logWarning "Could not parse version of $pack"
fi
if ! pack_release_type=$(basename "$pack" | grep -Eo '(beta|RC)(-[0-9]+)?' || echo ""); then
logWarning "Could not parse release type of $pack"
fi
if ! current_version=$(basename "$gtnh_download_path" | grep -Eo '[0-9]+(\.[0-9]+)+'); then
debug "Could not parse version of selected download path. String might be empty."
fi
if ! current_release_type=$(basename "$gtnh_download_path" | grep -Eo '(beta|RC)(-[0-9]+)?' || echo ""); then
debug "Could not parse release type of selected download path. String might be empty."
fi
# Check if the pack matches the desired type based on GTNH_PACK_VERSION:
# - If GTNH_PACK_VERSION is "latest-dev", only consider beta packs (path contains "/betas/").
# - If GTNH_PACK_VERSION is "latest", only consider non-beta packs (path does not contain "/betas/").
if [[ ($pack == *"/betas/"* && $GTNH_PACK_VERSION == "latest-dev") || ($pack != *"/betas/"* && $GTNH_PACK_VERSION == "latest") ]]; then
# Compare versions and update gtnh_download_path if pack is newer
# Check if the current version is unset or if the pack version is newer than the current version.
# This comparison uses version sorting to determine the latest version.
if [[ -z "$current_version" || "$(printf '%s\n' "$pack_version" "$current_version" | sort -V | tail -n 1)" == "$pack_version" ]]; then
# If the pack version is the same as the current version, prioritize based on release type.
# Full versions are preferred over RC (Release Candidate), and RC is preferred over beta.
# Within the same release type, higher numbered versions are preferred.
if [[ "$pack_version" == "$current_version" ]]; then
if [[ -z "$pack_release_type" || ("$pack_release_type" == "RC" && "$current_release_type" == "beta") ||
("$pack_release_type" == "$current_release_type" && "$(printf '%s\n' "$pack_release_type" "$current_release_type" | sort -V | tail -n 1)" == "$pack_release_type") ]]; then
debug "$current_version-$current_release_type is older than $pack_version-$pack_release_type! Update latest version to: $pack_version-$pack_release_type"
gtnh_download_path="$pack"
fi
else
# If the pack version is newer than the current version, set it as the download path.
debug "$current_version is older than $pack_version! Update latest version to: $pack_version"
gtnh_download_path="$pack"
fi
fi
else
if [[ "$pack_version" == "$GTNH_PACK_VERSION" || "$pack_version-$pack_release_type" == "$GTNH_PACK_VERSION" ]]; then
log "Found exact match $pack_version = $GTNH_PACK_VERSION! Select $pack_version for download."
gtnh_download_path="$pack"
break
fi
fi
done
}
function deleteGTNHbackup(){
log "Start deleting all config backups"
if ! find . -maxdepth 1 -type d -name 'gtnh-upgrade-*' -exec rm -rf {} + ; then
logWarning "Can not delete config backup!"
fi
}
function updateGTNH(){
# Get the current date and time
current_datetime=$(date +%Y-%m-%dT%H:%M)
# Define folders and files to update
folders_to_update=("libraries" "mods" "resources" "scripts")
files_to_update=("lwjgl3ify-forgePatches.jar" "java9args.txt" "startserver-java9.bat" "startserver-java9.sh" "forge-1.7.10-10.13.4.1614-1.7.10-universal.jar" "startserver.bat" "startserver.sh" "server-icon.png")
config_folder="config"
backup_folder="/data/gtnh-upgrade-${current_version}${current_release_type:+-$current_release_type}-$current_datetime"
journey_map_folder="JourneyMapServer"
# Delete specified folders if they exist
for folder in "${folders_to_update[@]}"; do
folder_path="/data/$folder"
if [[ -d "$folder_path" ]]; then
log "Deleting folder: $folder_path"
rm -rf "$folder_path"
fi
done
# Delete specific files if they exist
for file in "${files_to_update[@]}"; do
file_path="/data/$file"
if [[ -f "$file_path" ]]; then
log "Deleting file: $file_path"
rm -f "$file_path"
fi
done
# Backup the config folder
if [[ -d "/data/$config_folder" ]]; then
log "Creating backup of /data/$config_folder at $backup_folder"
cp -r "/data/$config_folder" "$backup_folder"
log "Deleting original /data/$config_folder"
rm -rf "/data/$config_folder"
fi
# Updating the required folders in data directory
for folder in "${folders_to_update[@]}" "$config_folder"; do
if [[ -d "$base_dir/$folder" ]]; then
log "Copying $folder to /data"
cp -r "$base_dir/$folder" "/data/"
else
logWarning "Folder $folder not found in the unzipped data!"
fi
done
# Copy specific files to the /data directory
for file in "${files_to_update[@]}"; do
if [[ -f "$base_dir/$file" ]]; then
log "Copying $file to /data"
cp "$base_dir/$file" "/data/"
else
logWarning "File $file not found in the unzipped data!"
fi
done
# Ensure the config folder exists
if [[ ! -d "$config_folder" ]]; then
log "$config_folder does not exist. Creating it now."
mkdir -p "$config_folder"
fi
# Restore JourneyMapServer folder from backup
if [[ -d "$backup_folder/$journey_map_folder" ]]; then
log "Restoring $journey_map_folder to $config_folder"
cp -r "$backup_folder/$journey_map_folder" "$config_folder/"
else
logWarning "$journey_map_folder not found in backup!"
fi
# Copy the changelog file to /data
gtnh_changelog_file=$(mc-image-helper find --max-depth=1 --type=file --name=changelog*.md "$base_dir")
if [[ -n "$gtnh_changelog_file" ]]; then
log "Copying changelog file to /data"
cp -f "$gtnh_changelog_file" /data/
fi
}
function handleGTNH() {
: "${GTNH_PACK_VERSION:=latest}"
: "${GTNH_DELETE_BACKUPS:=false}"
: "${SKIP_GTNH_UPDATE_CHECK:=false}"
debug "GTNH VAR CHECK: GTNH_DELETE_BACKUPS=$GTNH_DELETE_BACKUPS, GTNH_PACK_VERSION=$GTNH_PACK_VERSION, TYPE=$TYPE, SKIP_GTNH_UPDATE_CHECK=$SKIP_GTNH_UPDATE_CHECK"
if isTrue "$GTNH_DELETE_BACKUPS"; then
deleteGTNHbackup
fi
if [[ -n $GTNH_PACK_VERSION ]] && isFalse "$SKIP_GTNH_UPDATE_CHECK" ; then
getGTNHdownloadPath
if [[ -z $gtnh_download_path ]]; then
logError "Server files not found for GTNH_PACK_VERSION=$GTNH_PACK_VERSION! Download not possible!"
exit 1
fi
log "Server files located! Will proceed update $gtnh_download_path."
# Decide if update or install is needed or not.
if [[ ! -f /data/.gtnh-version || "$(basename "$gtnh_download_path")" != "$(cat /data/.gtnh-version)" ]]; then
log "Update/Install required: /data/.gtnh-version is missing or does not match the selected version $(basename "$gtnh_download_path")."
mkdir -p /data/packs
log "Downloading $gtnh_download_path."
if ! gtnh_download=$(mc-image-helper get -o /data/packs --output-filename --skip-up-to-date "$gtnh_download_path"); then
logError "Failed to download $gtnh_download_path"
exit 1
fi
# Unpacking Server files into temporary directory
log "Unpacking Server Files..."
original_base_dir=/data/.tmp/gtnh_base
base_dir=$original_base_dir
rm -rf "${base_dir}"
mkdir -p "${base_dir}"
extract "${gtnh_download}" "${base_dir}"
trap 'rm -rf /data/.tmp' EXIT
# Removing downloaded zip
rm -f "$gtnh_download"
# Remove any eula file since container manages it
rm -f "${base_dir}/eula.txt"
# recalculate the actual base directory of content
if ! base_dir=$(mc-image-helper find \
--max-depth=3 --type=directory --name=mods,config \
--only-shallowest --fail-no-matches --format '%h' \
"$base_dir"); then
logError "Unable to find content base of downloaded Server Files"
exit 1
fi
# Split installation from update path. Check for version file.
if [[ -f /data/.gtnh-version ]]; then
log ".gtnh-version file detected! Assuming old version already exists. Proceed updating existing server..."
updateGTNH
else
log "No .gtnh-version file detected! Assuming no old server exists. Proceed installing new server..."
cp -R -f "${base_dir}"/* /data
fi
# Update .gtnh-version
basename "$gtnh_download_path" > /data/.gtnh-version
# Cleaning up
rm -rf "$original_base_dir"
else
log "No update required: /data/.gtnh-version matches the selected version $(basename "$gtnh_download_path")."
fi
else
log "SKIP_GTNH_UPDATE_CHECK=$SKIP_GTNH_UPDATE_CHECK ... Skipping GTNH Update/Install"
fi
}
# Set server.properties defaults suitable for gtnh servers
log "Applying GTNH optimized server defaults"
export ALLOW_FLIGHT="${ALLOW_FLIGHT:=true}"
export LEVEL_TYPE="${LEVEL_TYPE:=rwg}"
export DIFFICULTY="${DIFFICULTY:=3}"
export ENABLE_COMMAND_BLOCK="${ENABLE_COMMAND_BLOCK:=true}"
export MOTD="${MOTD:="Greg Tech New Horizon $GTNH_PACK_VERSION"}"
debug "Set MOTD=$MOTD, ENABLE_COMMAND_BLOCK=$ENABLE_COMMAND_BLOCK, DIFFICULTY=$DIFFICULTY, LEVEL_TYPE=$LEVEL_TYPE, ALLOW_FLIGHT=$ALLOW_FLIGHT"
isDebugging && set -x
ensureRemoveAllModsOff "MODPACK_PLATFORM=GTNH"
java_version=$(mc-image-helper java-release)
if (( java_version == 8 )); then
export SERVER=/data/forge-1.7.10-10.13.4.1614-1.7.10-universal.jar
elif (( java_version >= 17 )); then
export SERVER=/data/lwjgl3ify-forgePatches.jar
else
logError "Greg Tech New Horizons only supports the following Java versions: 8, 17 or later"
exit 1
fi
log "TYPE=GTNH, setting Minecraft version to 1.7.10"
export VERSION=1.7.10
# Start setup gtnh server files
handleGTNH
export USES_MODS=true
exec "$(dirname "$0")/start-setupWorld" "$@"

View File

@@ -8,18 +8,14 @@ isDebugging && set -x
resolveVersion
if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest/${MAGMA_VERSION}"); then
logError "Failed to locate latest Magma download for ${VERSION}. Is that version supported?"
exit 1
# Neo Magma currently supports just 1.21.x
if [[ ! $VERSION = 1.21.* ]]; then
logError "Magma does not support $VERSION (expected 1.21.x)"
exit 1
fi
if [[ $downloadUrl == null ]]; then
logError "Magma does not seem to be available for $VERSION"
exit 1
fi
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
logError "Failed to download Magma server jar from $downloadUrl"
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "https://magmafoundation.org/api/versions/${MAGMA_VERSION}/download"); then
logError "Failed to download Magma server jar for $MAGMA_VERSION"
exit 1
fi

View File

@@ -40,13 +40,14 @@ fi
case "${VERSION^^}" in
LATEST)
: "${MODRINTH_DEFAULT_VERSION_TYPE:=release}"
# need to be backward compatible with old variable name, MODRINTH_DEFAULT_VERSION_TYPE
: "${MODRINTH_MODPACK_VERSION_TYPE:=${MODRINTH_DEFAULT_VERSION_TYPE:-release}}"
;;
SNAPSHOT)
: "${MODRINTH_DEFAULT_VERSION_TYPE:=beta}"
: "${MODRINTH_MODPACK_VERSION_TYPE:=${MODRINTH_DEFAULT_VERSION_TYPE:-beta}}"
;;
*)
: "${MODRINTH_DEFAULT_VERSION_TYPE:=release}"
: "${MODRINTH_MODPACK_VERSION_TYPE:=${MODRINTH_DEFAULT_VERSION_TYPE:-release}}"
args+=("--game-version=$VERSION")
;;
esac
@@ -61,7 +62,7 @@ setArg() {
}
setArg --loader MODRINTH_LOADER
setArg --version MODRINTH_VERSION
setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
setArg --default-version-type MODRINTH_MODPACK_VERSION_TYPE
setArg --exclude-files MODRINTH_EXCLUDE_FILES
setArg --force-include-files MODRINTH_FORCE_INCLUDE_FILES
setArg --overrides-exclusions MODRINTH_OVERRIDES_EXCLUSIONS

View File

@@ -14,11 +14,12 @@ if ! SERVER=$(mc-image-helper github download-latest-asset \
fi
: "${SERVER_PORT:=25565}"
cat <<EOF > /data/settings.yml
if [ ! -f /data/settings.yml ]; then
cat <<EOF > /data/settings.yml
#
# NanoLimbo configuration
#
# Server's host address and port. Set ip empty to use public address
bind:
ip: '0.0.0.0'
@@ -157,8 +158,11 @@ traffic:
# Ignored if -1.0
maxPacketBytesRate: 2048.0
EOF
fi
mc-image-helper patch --patch-env-prefix "" /image/nanolimbo-settings-patch.json
export SERVER
export FAMILY=LIMBO
exec "$(dirname "$0")/start-setupMounts" "$@"
exec "$(dirname "$0")/start-setupMounts" "$@"

View File

@@ -349,12 +349,34 @@ if isTrue "${USE_SIMD_FLAGS}"; then
"
fi
# Handle GTNH args
if isType "GTNH"; then
expandedDOpts="${expandedDOpts} -Dfml.readTimeout=180"
java_major_version=$(mc-image-helper java-release)
if (( java_major_version == 8 )); then
debug "Setting GTNH java8 args."
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UseStringDeduplication
-XX:+UseCompressedOops
-XX:+UseCodeCacheFlushing
"
elif (( java_major_version >= 17 )); then
debug "Setting GTNH java17+ args."
expandedDOpts="${expandedDOpts} @java9args.txt"
fi
fi
if [[ ${INIT_MEMORY} || ${MAX_MEMORY} ]]; then
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
if [[ ${INIT_MEMORY} ]]; then
if isPercentage "$INIT_MEMORY"; then
JVM_OPTS="-XX:InitialRAMPercentage=$(getPercentageValue "${INIT_MEMORY}") ${JVM_OPTS}"
elif [[ ${INIT_MEMORY} ]]; then
JVM_OPTS="-Xms${INIT_MEMORY} ${JVM_OPTS}"
fi
if [[ ${MAX_MEMORY} ]]; then
if isPercentage "$MAX_MEMORY"; then
JVM_OPTS="-XX:MaxRAMPercentage=$(getPercentageValue "${MAX_MEMORY}") ${JVM_OPTS}"
elif [[ ${MAX_MEMORY} ]]; then
JVM_OPTS="-Xmx${MAX_MEMORY} ${JVM_OPTS}"
fi
fi
@@ -371,6 +393,12 @@ if versionLessThan 'b1.8'; then
echo "
DISABLE_HEALTHCHECK=true
" > "$mcHealthEnvPath"
elif versionLessThan 1.3; then
echo "
MC_HEALTH_EXTRA_ARGS=(
--use-old-server-list-ping
)
" > "$mcHealthEnvPath"
elif versionLessThan 1.7; then
echo "
MC_HEALTH_EXTRA_ARGS=(
@@ -414,15 +442,34 @@ elif [[ ${TYPE} == "CURSEFORGE" ]]; then
copyFilesForCurseForge
if isPercentage "$INIT_MEMORY" || isPercentage "$MAX_MEMORY"; then
# Convert to bytes
NORM_INIT_MEM=$(normalizeMemSize "$INIT_MEMORY")
NORM_MAX_MEM=$(normalizeMemSize "$MAX_MEMORY")
# Convert to MB
((NORM_INIT_MEM*=1048576))
((NORM_MAX_MEM*=1048576))
cat > "${FTB_DIR}/settings-local.sh" <<EOF
export MIN_RAM="${NORM_INIT_MEM}M"
export MAX_RAM="${NORM_MAX_MEM}M"
export JAVA_PARAMETERS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
EOF
else
cat > "${FTB_DIR}/settings-local.sh" <<EOF
export MIN_RAM="${INIT_MEMORY}"
export MAX_RAM="${MAX_MEMORY}"
export JAVA_PARAMETERS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
EOF
fi
# patch CurseForge cfg file, if present
if [ -f "${FTB_DIR}/settings.cfg" ] && [[ ${MAX_MEMORY} ]]; then
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
if isPercentage "$MAX_MEMORY"; then
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${NORM_MAX_MEM}M/" "${FTB_DIR}/settings.cfg"
else
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
fi
fi
cd "${FTB_DIR}" || (logError "Can't go into ${FTB_DIR}"; exit 1)

View File

@@ -17,7 +17,7 @@ handleDebugMode
: "${DOWNLOAD_DEFAULTS:=}"
: "${DOWNLOAD_DEFAULT_CONFIGS:=}"
: "${SKIP_DOWNLOAD_DEFAULTS:=false}"
: "${DOWNLOAD_EXTRA_CONFIGS:=}"
: "${APPLY_EXTRA_FILES:=${DOWNLOAD_EXTRA_CONFIGS:-}}"
if isTrue "${REPLACE_ENV_IN_PLACE}"; then
log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix '$REPLACE_ENV_VARIABLE_PREFIX' ..."
@@ -55,13 +55,13 @@ if isFalse "$SKIP_DOWNLOAD_DEFAULTS"; then
fi
fi
if [[ $DOWNLOAD_EXTRA_CONFIGS ]]; then
if [[ $APPLY_EXTRA_FILES ]]; then
mc-image-helper mcopy \
--to /data \
--skip-existing \
--skip-up-to-date=false \
--quiet-when-skipped \
"$DOWNLOAD_EXTRA_CONFIGS"
"$APPLY_EXTRA_FILES"
fi
if [[ ${PATCH_DEFINITIONS} ]]; then

View File

@@ -253,7 +253,8 @@ function handleGenericPacks() {
}
function handleModrinthProjects() {
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
# need to be backward compatible with old variable name, MODRINTH_ALLOWED_VERSION_TYPE
: "${MODRINTH_PROJECTS_DEFAULT_VERSION_TYPE:=${MODRINTH_ALLOWED_VERSION_TYPE:-release}}"
: "${MODRINTH_DOWNLOAD_DEPENDENCIES:=none}"
if [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]; then
logWarning "The variable MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES is removed."
@@ -283,7 +284,7 @@ function handleModrinthProjects() {
--game-version="${VERSION}" \
--loader="$loader" \
--download-dependencies="$MODRINTH_DOWNLOAD_DEPENDENCIES" \
--allowed-version-type="$MODRINTH_ALLOWED_VERSION_TYPE"
--allowed-version-type="$MODRINTH_PROJECTS_DEFAULT_VERSION_TYPE"
fi
}
@@ -312,7 +313,7 @@ function handleCurseForgeFiles() {
# since we want CURSEFORGE_FILES to expand
mc-image-helper curseforge-files \
"${args[@]}" \
${CURSEFORGE_FILES}
"${CURSEFORGE_FILES}"
}
handlePackwiz

View File

@@ -39,6 +39,23 @@ function get_major_version() {
echo "$version" | cut -d. -f 1-2
}
function isPercentage() {
local value=$1
[[ $value =~ ^[0-9]+(\.[0-9]+)?\s*%$ ]]
}
function getPercentageValue() {
local value=$1
if [[ "$value" =~ ^([0-9]+(\.[0-9]+)?)\s*%$ ]]; then
echo "${BASH_REMATCH[1]}"
return 0
else
logError "Value '$value' is not a valid percentage."
return 1
fi
}
function isURL() {
local value=$1
@@ -121,17 +138,6 @@ function log() {
eval "$oldState"
}
function getSudoFromDistro(){
distro=$(getDistro)
command=
if [[ $distro == alpine ]]; then
command="su-exec"
else
command="gosu"
fi
echo $command
}
# Refer to https://unix.stackexchange.com/a/10065/102376
function isTerminal() {
if test -t 1; then
@@ -240,6 +246,7 @@ function logRcon() {
function normalizeMemSize() {
local scale=1
local mem=1
case ${1,,} in
*k)
scale=1024
@@ -250,10 +257,20 @@ function normalizeMemSize() {
*g)
scale=1073741824
;;
*%)
# Get system memory
if [ -f "/sys/fs/cgroup/memory/memory.limit_in_bytes" ]; then
mem=$( cat /sys/fs/cgroup/memory/memory.limit_in_bytes )
elif [ -f "/sys/fs/cgroup/memory.max" ]; then
mem=$( cat /sys/fs/cgroup/memory.max )
fi
# Scale is used to transform percentages into decimals (eg. 60 -> 0.6)
scale=0.01
;;
esac
val=${1:0:-1}
echo $((val * scale))
echo $((val * scale * mem))
}
function compare_version() {
@@ -272,22 +289,23 @@ function compare_version() {
fi
# Handle version channels ('a', 'b', or numeric)
if [[ $left_version == a* || $left_version == b* ]]; then
if [[ $left_version == a* ]]; then
left_version=${left_version:1}
left_version_channel=1
elif [[ $left_version == b* ]]; then
left_version=${left_version:1}
left_version_channel=2
else
left_version_channel=3
fi
if [[ $right_version == a* || $right_version == b* ]]; then
if [[ $right_version == a* ]]; then
right_version=${right_version:1}
fi
local left_version_channel=${left_version:0:1}
if [[ $left_version_channel =~ [0-9] ]]; then
left_version_channel='r'
fi
local right_version_channel=${right_version:0:1}
if [[ $right_version_channel =~ [0-9] ]]; then
right_version_channel='r'
right_version_channel=1
elif [[ $right_version == b* ]]; then
right_version=${right_version:1}
right_version_channel=2
else
right_version_channel=3
fi
if [[ $comparison == "lt" && $left_version_channel < $right_version_channel ]]; then

View File

@@ -1,12 +1,14 @@
services:
monitor:
depends_on:
- mc
mc:
condition: service_started
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
entrypoint: mc-monitor
command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 60
restart: no
mc:
restart: "no"
restart: no
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
@@ -14,4 +16,3 @@ services:
TYPE: PAPER
# regression tests https://github.com/itzg/docker-minecraft-server/issues/2545
MOTD: "Foo§rBar"

28
tests/fulltests/test.sh Normal file → Executable file
View File

@@ -3,24 +3,28 @@
# go to script root directory
cd "$(dirname "$0")" || exit 1
down() {
docker compose -f "$1" down -v --remove-orphans
}
# tests to completely spin up Minecraft and use the monitor to validate the service is running.
fullMinecraftUpTest(){
file="$1"
failed=false
result=0
echo "Testing with images:"
docker compose -f "$file" config --images
# run the monitor to validate the Minecraft image is healthy
docker compose -f "$file" run monitor || failed=true
echo "$(dirname "$file") Result: failed=$failed"
if $failed; then
docker compose logs mc
down "$file"
return 1
upArgs=(
--attach-dependencies
--always-recreate-deps
--abort-on-container-failure
)
if ! docker compose -f "$file" up "${upArgs[@]}" monitor; then
echo "$(dirname "$file") Result: failed"
result=1
else
down "$file"
echo "$(dirname "$file") Result: success"
fi
docker compose -f "$file" down -v --remove-orphans
return $result
}
# go through each folder in fulltests and run fullbuilds

View File

@@ -1,12 +1,14 @@
services:
monitor:
depends_on:
- mc
mc:
condition: service_started
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
entrypoint: mc-monitor
command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 300
restart: no
mc:
restart: "no"
restart: no
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"

View File

@@ -3,9 +3,15 @@ services:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost/configs.zip"]
interval: 3s
timeout: 5s
retries: 3
mc:
depends_on:
- web
web:
condition: service_healthy
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"

View File

@@ -3,9 +3,16 @@ services:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
healthcheck:
test:
["CMD", "curl", "--fail", "http://localhost/motion-tween-example.gif"]
interval: 3s
timeout: 5s
retries: 3
mc:
depends_on:
- web
web:
condition: service_healthy
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"

View File

@@ -3,9 +3,21 @@ services:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
healthcheck:
test:
[
"CMD",
"curl",
"--fail",
"http://localhost/4737386_minecraft_squircle_icon.png",
]
interval: 3s
timeout: 5s
retries: 3
mc:
depends_on:
- web
web:
condition: service_healthy
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"

View File

@@ -3,9 +3,21 @@ services:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
healthcheck:
test:
[
"CMD",
"curl",
"--fail",
"http://localhost/4737386_minecraft_squircle_icon.png",
]
interval: 3s
timeout: 5s
retries: 3
mc:
depends_on:
- web
web:
condition: service_healthy
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"

View File

@@ -3,9 +3,15 @@ services:
image: nginx
volumes:
- ./web:/usr/share/nginx/html
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost/pack.toml"]
interval: 3s
timeout: 5s
retries: 3
mc:
depends_on:
- web
web:
condition: service_healthy
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"