mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-10 02:25:10 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c190e21a2 |
@@ -92,27 +92,27 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
mcVersion: 1.12.2
|
mcVersion: 1.12.2
|
||||||
# Pin version for Java 8
|
# Pin version for Java 8
|
||||||
mcHelperVersion: 1.51.1
|
# mcHelperVersion: 1.46.0
|
||||||
- variant: java8-graalvm-ce
|
- variant: java8-graalvm-ce
|
||||||
baseImage: ghcr.io/graalvm/graalvm-ce:java8
|
baseImage: ghcr.io/graalvm/graalvm-ce:java8
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
mcVersion: 1.12.2
|
mcVersion: 1.12.2
|
||||||
# Pin version for Java 8
|
# Pin version for Java 8
|
||||||
mcHelperVersion: 1.51.1
|
# mcHelperVersion: 1.46.0
|
||||||
- variant: java8-jdk
|
- variant: java8-jdk
|
||||||
baseImage: eclipse-temurin:8u312-b07-jdk-focal
|
baseImage: eclipse-temurin:8u312-b07-jdk-focal
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
mcVersion: 1.12.2
|
mcVersion: 1.12.2
|
||||||
# Pin version for Java 8
|
# Pin version for Java 8
|
||||||
mcHelperVersion: 1.51.1
|
# mcHelperVersion: 1.46.0
|
||||||
env:
|
env:
|
||||||
IMAGE_TO_TEST: "${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}"
|
IMAGE_TO_TEST: "${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}"
|
||||||
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
|
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
|
||||||
MAIN_VARIANT: java25
|
MAIN_VARIANT: java21
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.1
|
uses: actions/checkout@v6.0.0
|
||||||
with:
|
with:
|
||||||
# for build-files step
|
# for build-files step
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -149,7 +149,7 @@ jobs:
|
|||||||
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.12.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3.7.0
|
uses: docker/setup-qemu-action@v3.7.0
|
||||||
@@ -175,7 +175,6 @@ jobs:
|
|||||||
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
|
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
|
||||||
VARIANT: ${{ matrix.variant }}
|
VARIANT: ${{ matrix.variant }}
|
||||||
CF_API_KEY: ${{ secrets.CF_API_KEY }}
|
CF_API_KEY: ${{ secrets.CF_API_KEY }}
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
run: |
|
||||||
tests/test.sh
|
tests/test.sh
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
name: Verify PR
|
name: Verify PR
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches: [ master ]
|
||||||
- master
|
types: [assigned, opened, synchronize, labeled]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "*.md"
|
- "*.md"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
@@ -19,14 +19,14 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
variant:
|
variant:
|
||||||
- java25
|
- java21
|
||||||
- java21-alpine
|
- java21-alpine
|
||||||
- java17
|
- java17
|
||||||
- java8
|
- java8
|
||||||
include:
|
include:
|
||||||
# JAVA 21/25:
|
# JAVA 21:
|
||||||
- variant: java25
|
- variant: java21
|
||||||
baseImage: eclipse-temurin:25-jre
|
baseImage: eclipse-temurin:21-jre
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
mcVersion: latest
|
mcVersion: latest
|
||||||
- variant: java21-alpine
|
- variant: java21-alpine
|
||||||
@@ -44,19 +44,19 @@ jobs:
|
|||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
mcVersion: 1.12.2
|
mcVersion: 1.12.2
|
||||||
# Pin version for Java 8
|
# Pin version for Java 8
|
||||||
mcHelperVersion: 1.51.1
|
# mcHelperVersion: 1.42.1
|
||||||
env:
|
env:
|
||||||
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
|
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.1
|
uses: actions/checkout@v6.0.0
|
||||||
with:
|
with:
|
||||||
# for build-files step
|
# for build-files step
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.12.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
- name: Confirm multi-arch build
|
- name: Confirm multi-arch build
|
||||||
uses: docker/build-push-action@v6.18.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
@@ -92,6 +92,5 @@ jobs:
|
|||||||
VARIANT: ${{ matrix.variant }}
|
VARIANT: ${{ matrix.variant }}
|
||||||
CF_API_KEY: ${{ secrets.CF_API_KEY }}
|
CF_API_KEY: ${{ secrets.CF_API_KEY }}
|
||||||
DEBUG: ${{ runner.debug }}
|
DEBUG: ${{ runner.debug }}
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
run: |
|
||||||
tests/test.sh
|
tests/test.sh
|
||||||
|
|||||||
@@ -4,4 +4,3 @@
|
|||||||
*.iml
|
*.iml
|
||||||
/gh-md-toc
|
/gh-md-toc
|
||||||
personal-build-and-develop.*
|
personal-build-and-develop.*
|
||||||
site/
|
|
||||||
|
|||||||
+14
-22
@@ -1,22 +1,14 @@
|
|||||||
version: 2
|
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||||
|
version: 2
|
||||||
python:
|
|
||||||
install:
|
build:
|
||||||
- requirements: docs/requirements.txt
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
build:
|
python: "3.11"
|
||||||
os: ubuntu-24.04
|
|
||||||
tools:
|
mkdocs:
|
||||||
python: latest
|
configuration: mkdocs.yml
|
||||||
jobs:
|
|
||||||
# We recommend using a requirements file for reproducible builds.
|
python:
|
||||||
# This is just a quick example to get started.
|
install:
|
||||||
# https://docs.readthedocs.io/page/guides/reproducible-builds.html
|
- requirements: docs/requirements.txt
|
||||||
install:
|
|
||||||
- pip install zensical
|
|
||||||
build:
|
|
||||||
html:
|
|
||||||
- zensical build
|
|
||||||
post_build:
|
|
||||||
- mkdir -p $READTHEDOCS_OUTPUT/html/
|
|
||||||
- cp --recursive site/* $READTHEDOCS_OUTPUT/html/
|
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
ARG BASE_IMAGE=eclipse-temurin:25-jre
|
ARG BASE_IMAGE=eclipse-temurin:21-jre
|
||||||
FROM ${BASE_IMAGE}
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
@@ -44,12 +44,12 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_SERVER_RUNNER_VERSION=1.14.1
|
ARG MC_SERVER_RUNNER_VERSION=1.14.0
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.52.1
|
ARG MC_HELPER_VERSION=1.51.1
|
||||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
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
|
# used for cache busting local copy of mc-image-helper
|
||||||
ARG MC_HELPER_REV=1
|
ARG MC_HELPER_REV=1
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ dnf clean all
|
|||||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
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
|
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||||
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
||||||
ls -l /usr/local/sbin/knockd
|
|
||||||
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
||||||
|
|
||||||
# Set git credentials globally
|
# Set git credentials globally
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
# This composition can be used to serve up the rendered mkdocs for local authoring.
|
|
||||||
#
|
|
||||||
# docker compose -f compose-docs.yml -p zensical up
|
|
||||||
#
|
|
||||||
# and then access http://localhost:8000
|
|
||||||
|
|
||||||
services:
|
|
||||||
zensical:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: docs/Dockerfile
|
|
||||||
volumes:
|
|
||||||
- ./zensical.toml:/docs/zensical.toml
|
|
||||||
- ./docs:/docs/docs
|
|
||||||
ports:
|
|
||||||
- "8000:8000"
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# This composition can be used to serve up the rendered mkdocs for local authoring.
|
||||||
|
#
|
||||||
|
# docker compose -f docker-compose-mkdocs.yml -p mkdocs up
|
||||||
|
#
|
||||||
|
# and then access http://localhost:8000
|
||||||
|
|
||||||
|
services:
|
||||||
|
mkdocs:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: docs/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./mkdocs.yml:/mkdocs/mkdocs.yml
|
||||||
|
- ./docs:/mkdocs/docs
|
||||||
|
command:
|
||||||
|
- serve
|
||||||
|
- --dev-addr=0.0.0.0:8000
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
+7
-1
@@ -1,4 +1,10 @@
|
|||||||
FROM zensical/zensical
|
FROM python:3.11
|
||||||
|
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
|
WORKDIR /mkdocs
|
||||||
|
|
||||||
RUN --mount=target=/build/requirements.txt,source=docs/requirements.txt \
|
RUN --mount=target=/build/requirements.txt,source=docs/requirements.txt \
|
||||||
pip install -r /build/requirements.txt
|
pip install -r /build/requirements.txt
|
||||||
|
|
||||||
|
ENTRYPOINT ["mkdocs"]
|
||||||
@@ -77,74 +77,15 @@ The openj9 image tags include specific variables to simplify configuration:
|
|||||||
- `-e TUNE_NURSERY_SIZES=TRUE` : configures nursery sizes where the initial size is 50%
|
- `-e TUNE_NURSERY_SIZES=TRUE` : configures nursery sizes where the initial size is 50%
|
||||||
of the `MAX_MEMORY` and the max size is 80%.
|
of the `MAX_MEMORY` and the max size is 80%.
|
||||||
|
|
||||||
## Customize Minecraft server logging
|
## Enabling rolling logs
|
||||||
|
|
||||||
The image can use a templated log4j2 configuration based on PaperMC's logging setup, which is automatically applied for versions that don't require Log4j security patches. This configuration provides rolling logs and advanced logging features by default.
|
By default the vanilla log file will grow without limit. The logger can be reconfigured to use a rolling log files strategy by using:
|
||||||
|
|
||||||
Set the environment variable `GENERATE_LOG4J2_CONFIG` to "true" to enable the following features.
|
```
|
||||||
|
-e ENABLE_ROLLING_LOGS=true
|
||||||
!!! note
|
|
||||||
|
|
||||||
This configures the server logging only. To diagnose container startup, set the `DEBUG` environment variable to "true".
|
|
||||||
|
|
||||||
### Customization via environment variables
|
|
||||||
|
|
||||||
You can customize various aspects of the logging behavior using environment variables:
|
|
||||||
|
|
||||||
- `LOG_LEVEL` : Root logger level (default: `info`)
|
|
||||||
```
|
|
||||||
-e LOG_LEVEL=debug
|
|
||||||
```
|
|
||||||
|
|
||||||
- `ROLLING_LOG_FILE_PATTERN` : Pattern for rolled log file names (default: `logs/%d{yyyy-MM-dd}-%i.log.gz`)
|
|
||||||
```
|
|
||||||
-e ROLLING_LOG_FILE_PATTERN="logs/archive/%d{yyyy-MM-dd}-%i.log.gz"
|
|
||||||
```
|
|
||||||
|
|
||||||
- `ROLLING_LOG_MAX_FILES` : Maximum number of archived log files to keep (default: `1000`)
|
|
||||||
```
|
|
||||||
-e ROLLING_LOG_MAX_FILES=30
|
|
||||||
```
|
|
||||||
|
|
||||||
### Customizing log message formats
|
|
||||||
|
|
||||||
For full control over how log messages are formatted, you can customize the Log4j2 pattern layouts using these variables. These use [Log4j2 Pattern Layout syntax](https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout):
|
|
||||||
|
|
||||||
- `LOG_CONSOLE_FORMAT` : Format for console output (what you see in `docker logs`)
|
|
||||||
Default: `[%d{HH:mm:ss}] [%t/%level]: %msg%n`
|
|
||||||
|
|
||||||
- `LOG_FILE_FORMAT` : Format for file logs (written to `logs/latest.log`)
|
|
||||||
Default: `[%d{HH:mm:ss}] [%t/%level]: %msg%n`
|
|
||||||
|
|
||||||
- `LOG_TERMINAL_FORMAT` : Format for interactive terminal console (used with `docker attach`)
|
|
||||||
Default: `[%d{HH:mm:ss} %level]: %msg%n`
|
|
||||||
|
|
||||||
### Example configurations
|
|
||||||
|
|
||||||
Simple timestamp customization (most common use case):
|
|
||||||
```yaml
|
|
||||||
environment:
|
|
||||||
# What you see in docker logs
|
|
||||||
LOG_CONSOLE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%t/%level]: %msg%n"
|
|
||||||
# What gets written to logs/latest.log
|
|
||||||
LOG_FILE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%t/%level]: %msg%n"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Advanced customization:
|
> **NOTE** this will interfere with interactive/color consoles [as described in the section above](#interactive-and-color-console)
|
||||||
```yaml
|
|
||||||
environment:
|
|
||||||
LOG_LEVEL: debug
|
|
||||||
# Custom ISO8601 format with logger names
|
|
||||||
LOG_CONSOLE_FORMAT: "%d{ISO8601} %-5level [%t] %logger{36} - %msg%n"
|
|
||||||
LOG_FILE_FORMAT: "%d{ISO8601} %-5level [%t] %logger{36} - %msg%n"
|
|
||||||
ROLLING_LOG_MAX_FILES: 50
|
|
||||||
```
|
|
||||||
|
|
||||||
### Legacy ENABLE_ROLLING_LOGS option
|
|
||||||
|
|
||||||
The `ENABLE_ROLLING_LOGS` environment variable is no longer needed for most use cases, as rolling logs are now enabled by default through the templated configuration. This option is maintained for backward compatibility but is only checked for error reporting when rolling logs cannot be used due to Log4j security patches.
|
|
||||||
|
|
||||||
> **NOTE** The templated log4j2 configuration may interfere with interactive/color consoles [as described in the section above](#interactive-and-color-console)
|
|
||||||
|
|
||||||
## Timezone Configuration
|
## Timezone Configuration
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
To unify management of the Minecraft server container, all known [`server.properties`](https://minecraft.wiki/w/Server.properties) entries can be managed by the environment variables described in the sections below. Some mappings provide additional functionality above and beyond the properties file and will be described in the sections below.
|
In order to unify management of the Minecraft server container, all of the [`server.properties`](https://minecraft.wiki/w/Server.properties) entries can be managed by the environment variables described in the sections below. Some of the mappings provide additional functionality above and beyond the properties file.
|
||||||
|
|
||||||
!!! warning "Version compatibility"
|
|
||||||
|
|
||||||
Not all server properties are supported by all versions of Minecraft. Since this image supports a wide range of versions, please consult the [server properties documentation](https://minecraft.wiki/w/Server.properties) for the version you are using.
|
|
||||||
|
|
||||||
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".
|
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".
|
||||||
|
|
||||||
@@ -242,46 +238,15 @@ By default an existing `server-icon.png` file will not be replaced, that can be
|
|||||||
|
|
||||||
### RCON
|
### RCON
|
||||||
|
|
||||||
RCON is **enabled by default** to allow for graceful shut down of the server and coordination of save state during backups. RCON can be disabled by setting `ENABLE_RCON` to "false".
|
RCON is **enabled by default** to allow for graceful shut down the server and coordination of save state during backups. RCON can be disabled by setting `ENABLE_RCON` to "false".
|
||||||
|
|
||||||
!!! warning
|
!!! warning
|
||||||
|
|
||||||
Disabling RCON will remove and limit some features, such as interactive and color console support.
|
Disabling RCON will remove and limit some features, such as interactive and color console support.
|
||||||
|
|
||||||
#### RCON Password
|
The default password is randomly generated on each startup; however, a specific one can be set with `RCON_PASSWORD`.
|
||||||
|
|
||||||
The default password is randomly generated on each startup. However, you can specify a password using one of the following environment variables:
|
**DO NOT MAP THE RCON PORT EXTERNALLY** unless you are aware of all the consequences and have set a **secure password** with `RCON_PASSWORD`.
|
||||||
|
|
||||||
* Set `RCON_PASSWORD` to your desired password.
|
|
||||||
* Set `RCON_PASSWORD_FILE` to the path of a file containing the password.
|
|
||||||
|
|
||||||
Using `RCON_PASSWORD_FILE` is the recommended method for managing sensitive data, as it allows full support for [Docker Secrets](https://docs.docker.com/compose/how-tos/use-secrets/).
|
|
||||||
|
|
||||||
??? example
|
|
||||||
```yaml title="compose.yaml"
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
image: itzg/minecraft-server:latest
|
|
||||||
pull_policy: daily
|
|
||||||
tty: true
|
|
||||||
stdin_open: true
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
RCON_PASSWORD_FILE: /run/secrets/rcon_pass # Points to the path where the secret is mounted
|
|
||||||
volumes:
|
|
||||||
# attach the relative directory 'data' to the container's /data path
|
|
||||||
- ./data:/data
|
|
||||||
secrets:
|
|
||||||
- rcon_pass
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
rcon_pass:
|
|
||||||
file: ./rcon_password # local file containing the password
|
|
||||||
```
|
|
||||||
!!! warning
|
|
||||||
**BE CAUTIOUS OF MAPPING THE RCON PORT EXTERNALLY** unless you are aware of all the consequences and have set a **secure password**.
|
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
@@ -431,16 +396,11 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
|||||||
|
|
||||||
### Other server property mappings
|
### Other server property mappings
|
||||||
|
|
||||||
!!! warning "Version compatibility"
|
|
||||||
|
|
||||||
Not all server properties are supported by all versions of Minecraft. Since this image supports a wide range of versions, please consult the [server properties documentation](https://minecraft.wiki/w/Server.properties) for the version you are using.
|
|
||||||
|
|
||||||
| Environment Variable | Server Property |
|
| Environment Variable | Server Property |
|
||||||
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| ACCEPTS_TRANSFERS | [accepts-transfers](https://minecraft.wiki/w/Server.properties#accepts-transfers) |
|
| ACCEPTS_TRANSFERS | [accepts-transfers](https://minecraft.wiki/w/Server.properties#accepts-transfers) |
|
||||||
| ALLOW_FLIGHT | [allow-flight](https://minecraft.wiki/w/Server.properties#allow-flight) |
|
| ALLOW_FLIGHT | [allow-flight](https://minecraft.wiki/w/Server.properties#allow-flight) |
|
||||||
| ALLOW_NETHER | [allow-nether](https://minecraft.wiki/w/Server.properties#allow-nether) |
|
| ALLOW_NETHER | [allow-nether](https://minecraft.wiki/w/Server.properties#allow-nether) |
|
||||||
| ANNOUNCE_PLAYER_ACHIEVEMENTS | [announce-player-achievements](https://minecraft.wiki/w/Server.properties#announce-player-achievements) |
|
|
||||||
| BROADCAST_CONSOLE_TO_OPS | [broadcast-console-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-console-to-ops) |
|
| BROADCAST_CONSOLE_TO_OPS | [broadcast-console-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-console-to-ops) |
|
||||||
| BROADCAST_RCON_TO_OPS | [broadcast-rcon-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-rcon-to-ops) |
|
| BROADCAST_RCON_TO_OPS | [broadcast-rcon-to-ops](https://minecraft.wiki/w/Server.properties#broadcast-rcon-to-ops) |
|
||||||
| BUG_REPORT_LINK | [bug-report-link](https://minecraft.wiki/w/Server.properties#bug-report-link) |
|
| BUG_REPORT_LINK | [bug-report-link](https://minecraft.wiki/w/Server.properties#bug-report-link) |
|
||||||
@@ -451,7 +411,6 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
|||||||
| FORCE_GAMEMODE | [force-gamemode](https://minecraft.wiki/w/Server.properties#force-gamemode) |
|
| FORCE_GAMEMODE | [force-gamemode](https://minecraft.wiki/w/Server.properties#force-gamemode) |
|
||||||
| FUNCTION_PERMISSION_LEVEL | [function-permission-level](https://minecraft.wiki/w/Server.properties#function-permission-level) |
|
| FUNCTION_PERMISSION_LEVEL | [function-permission-level](https://minecraft.wiki/w/Server.properties#function-permission-level) |
|
||||||
| GENERATE_STRUCTURES | [generate-structures](https://minecraft.wiki/w/Server.properties#generate-structures) |
|
| GENERATE_STRUCTURES | [generate-structures](https://minecraft.wiki/w/Server.properties#generate-structures) |
|
||||||
| GENERATOR_SETTINGS | [generator-settings](https://minecraft.wiki/w/Server.properties#generator-settings) |
|
|
||||||
| HARDCORE | [hardcore](https://minecraft.wiki/w/Server.properties#hardcore) |
|
| HARDCORE | [hardcore](https://minecraft.wiki/w/Server.properties#hardcore) |
|
||||||
| HIDE_ONLINE_PLAYERS | [hide-online-players](https://minecraft.wiki/w/Server.properties#hide-online-players) |
|
| 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) |
|
| LOG_IPS | [log-ips](https://minecraft.wiki/w/Server.properties#log-ips) |
|
||||||
@@ -463,12 +422,6 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
|||||||
| MANAGEMENT_SERVER_TLS_ENABLED | [management-server-tls-enabled](https://minecraft.wiki/w/Server.properties#management-server-tls-enabled) |
|
| MANAGEMENT_SERVER_TLS_ENABLED | [management-server-tls-enabled](https://minecraft.wiki/w/Server.properties#management-server-tls-enabled) |
|
||||||
| MANAGEMENT_SERVER_TLS_KEYSTORE | [management-server-tls-keystore](https://minecraft.wiki/w/Server.properties#management-server-tls-keystore) |
|
| MANAGEMENT_SERVER_TLS_KEYSTORE | [management-server-tls-keystore](https://minecraft.wiki/w/Server.properties#management-server-tls-keystore) |
|
||||||
| MANAGEMENT_SERVER_TLS_KEYSTORE_PASSWORD | [management-server-tls-keystore-password](https://minecraft.wiki/w/Server.properties#management-server-tls-keystore-password) |
|
| MANAGEMENT_SERVER_TLS_KEYSTORE_PASSWORD | [management-server-tls-keystore-password](https://minecraft.wiki/w/Server.properties#management-server-tls-keystore-password) |
|
||||||
| MAX_BUILD_HEIGHT | [max-build-height](https://minecraft.wiki/w/Server.properties#max-build-height) |
|
|
||||||
| MAX_COMMAND_CHAIN_LENGTH | [max-command-chain-length](https://minecraft.wiki/w/Server.properties#max-command-chain-length) |
|
|
||||||
| MAX_ENTITY_CRAMMING | [max-entity-cramming](https://minecraft.wiki/w/Server.properties#max-entity-cramming) |
|
|
||||||
| MAX_ENTITY_COLLISION_RADIUS | [max-entity-collision-radius](https://minecraft.wiki/w/Server.properties#max-entity-collision-radius) |
|
|
||||||
| MAX_FUNCTION_CHAIN_DEPTH | [max-function-chain-depth](https://minecraft.wiki/w/Server.properties#max-function-chain-depth) |
|
|
||||||
| MAX_NEIGHBORS | [max-neighbors](https://minecraft.wiki/w/Server.properties#max-neighbors) |
|
|
||||||
| MAX_CHAINED_NEIGHBOR_UPDATES | [max-chained-neighbor-updates](https://minecraft.wiki/w/Server.properties#max-chained-neighbor-updates) |
|
| MAX_CHAINED_NEIGHBOR_UPDATES | [max-chained-neighbor-updates](https://minecraft.wiki/w/Server.properties#max-chained-neighbor-updates) |
|
||||||
| MAX_PLAYERS | [max-players](https://minecraft.wiki/w/Server.properties#max-players) |
|
| MAX_PLAYERS | [max-players](https://minecraft.wiki/w/Server.properties#max-players) |
|
||||||
| MAX_TICK_TIME | [max-tick-time](https://minecraft.wiki/w/Server.properties#max-tick-time) |
|
| MAX_TICK_TIME | [max-tick-time](https://minecraft.wiki/w/Server.properties#max-tick-time) |
|
||||||
@@ -486,12 +439,9 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
|
|||||||
| RESOURCE_PACK_PROMPT | [resource-pack-prompt](https://minecraft.wiki/w/Server.properties#resource-pack-prompt) |
|
| RESOURCE_PACK_PROMPT | [resource-pack-prompt](https://minecraft.wiki/w/Server.properties#resource-pack-prompt) |
|
||||||
| SERVER_NAME | [server-name](https://minecraft.wiki/w/Server.properties#server-name) |
|
| SERVER_NAME | [server-name](https://minecraft.wiki/w/Server.properties#server-name) |
|
||||||
| SIMULATION_DISTANCE | [simulation-distance](https://minecraft.wiki/w/Server.properties#simulation-distance) |
|
| SIMULATION_DISTANCE | [simulation-distance](https://minecraft.wiki/w/Server.properties#simulation-distance) |
|
||||||
| SNOOPER_ENABLED | [snooper-enabled](https://minecraft.wiki/w/Server.properties#snooper-enabled) |
|
|
||||||
| SPAWN_ANIMALS | [spawn-animals](https://minecraft.wiki/w/Server.properties#spawn-animals) |
|
|
||||||
| SPAWN_MONSTERS | [spawn-monsters](https://minecraft.wiki/w/Server.properties#spawn-monsters) |
|
| SPAWN_MONSTERS | [spawn-monsters](https://minecraft.wiki/w/Server.properties#spawn-monsters) |
|
||||||
| SPAWN_NPCS | [spawn-npcs](https://minecraft.wiki/w/Server.properties#spawn-npcs) |
|
|
||||||
| SPAWN_PROTECTION | [spawn-protection](https://minecraft.wiki/w/Server.properties#spawn-protection) |
|
| SPAWN_PROTECTION | [spawn-protection](https://minecraft.wiki/w/Server.properties#spawn-protection) |
|
||||||
| STATUS_HEARTBEAT_INTERVAL | [status-heartbeat-interval](https://minecraft.wiki/w/Server.properties#status-heartbeat-interval) |
|
| STATUS_HEARTBEAT_INTERVAL | [status-heartbeat-interval](https://minecraft.wiki/w/Server.properties#status-heartbeat-interval) |
|
||||||
| SYNC_CHUNK_WRITES | [sync-chunk-writes](https://minecraft.wiki/w/Server.properties#sync-chunk-writes) |
|
| SYNC_CHUNK_WRITES | [sync-chunk-writes](https://minecraft.wiki/w/Server.properties#sync-chunk-writes) |
|
||||||
| USE_NATIVE_TRANSPORT | [use-native-transport](https://minecraft.wiki/w/Server.properties#use-native-transport) |
|
| USE_NATIVE_TRANSPORT | [use-native-transport](https://minecraft.wiki/w/Server.properties#use-native-transport) |
|
||||||
| VIEW_DISTANCE | [view-distance](https://minecraft.wiki/w/Server.properties#view-distance) |
|
| VIEW_DISTANCE | [view-distance](https://minecraft.wiki/w/Server.properties#view-distance) |
|
||||||
+1
-2
@@ -35,7 +35,7 @@ where, in this case, the standard server port 25565 will be exposed on your host
|
|||||||
# ... image and environment section
|
# ... image and environment section
|
||||||
volumes:
|
volumes:
|
||||||
# attach the relative directory 'data' to the container's /data path
|
# attach the relative directory 'data' to the container's /data path
|
||||||
- ./data:data
|
./data:data
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
@@ -84,4 +84,3 @@ Follow the logs of the container using `docker compose logs -f`, check on the st
|
|||||||
|
|
||||||
!!! note "Deployment Examples"
|
!!! note "Deployment Examples"
|
||||||
The [deployments page](misc/deployment/index.md) provides more examples of deployment with and beyond Docker Compose.
|
The [deployments page](misc/deployment/index.md) provides more examples of deployment with and beyond Docker Compose.
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ A `.skip-pause` file can be created in the `/data` directory to make the server
|
|||||||
|
|
||||||
A starting, example compose file has been provided in [the examples](https://github.com/itzg/docker-minecraft-server/blob/master/examples/autopause/compose.yml).
|
A starting, example compose file has been provided in [the examples](https://github.com/itzg/docker-minecraft-server/blob/master/examples/autopause/compose.yml).
|
||||||
|
|
||||||
|
Auto-pause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
When configuring kubernetes readiness/liveness health checks with auto-pause enabled, be sure to reference the `mc-health` wrapper script rather than `mc-status` directly.
|
When configuring kubernetes readiness/liveness health checks with auto-pause enabled, be sure to reference the `mc-health` wrapper script rather than `mc-status` directly.
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
# Autoscaling (sleep when idle)
|
|
||||||
|
|
||||||
Autoscaling (sometimes called *sleeping*, *scale to zero* or *wake on join*) is the pattern of stopping a Minecraft server when nobody is playing and starting it again when someone tries to connect with the intention of saving resources when the server is not in use (e.g., on a VPS with limited CPU/RAM or a home server).
|
|
||||||
|
|
||||||
## mc-router
|
|
||||||
|
|
||||||
[mc-router](https://github.com/itzg/mc-router) is a Minecraft-aware router/multiplexer.
|
|
||||||
|
|
||||||
- Routes players by the hostname they connect with (useful for multiple servers behind one port)
|
|
||||||
- Can auto-start a backend container on join and stop it again after an idle timeout
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
- See the mc-router section in [Examples](../examples.md#mc-router-with-auto-scale)
|
|
||||||
|
|
||||||
## Lazymc
|
|
||||||
|
|
||||||
[Lazymc](https://github.com/timvisee/lazymc) can keep a server “asleep” until a player connects. With Docker it’s commonly used via [lazymc-docker-proxy](https://github.com/joesturge/lazymc-docker-proxy).
|
|
||||||
|
|
||||||
- Players connect to the proxy; the proxy starts/stops the server container
|
|
||||||
- Usually requires a static IP for the Minecraft container on a user-defined network
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
- See the Lazymc section in [Examples](../examples.md#lazymc-put-your-minecraft-server-to-rest-when-idle)
|
|
||||||
|
|
||||||
## Lazytainer
|
|
||||||
|
|
||||||
[Lazytainer](https://github.com/vmorganp/Lazytainer) starts/stops containers based on network traffic.
|
|
||||||
|
|
||||||
- Uses packet thresholds + inactivity timeouts (not Minecraft hostname aware)
|
|
||||||
- Can be triggered by port scans/pings in noisy environments
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
- See the Lazytainer section in [Examples](../examples.md#lazytainer-stop-minecraft-container-based-on-traffic)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Site documentation
|
# Site documentation
|
||||||
|
|
||||||
The documentation for this image/repository is written in markdown and built using [Zensical](https://zensical.org/) into a documentation website hosted at [Read the Docs](https://readthedocs.org/). [Here is general information about writing Zensical markdown](https://zensical.org/docs/authoring/markdown/).
|
The documentation for this image/repository is written in markdown and built by [MkDocs](https://www.mkdocs.org/) into a documentation website hosted at [Read the Docs](https://readthedocs.org/). [Here is general information about writing MkDocs markdown](https://www.mkdocs.org/user-guide/writing-your-docs/) and [specifics for the Material theme used](https://squidfunk.github.io/mkdocs-material/reference/).
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
The README.md rarely needs to be modified and only serves as a brief introduction to the project.
|
The README.md rarely needs to be modified and only serves as a brief introduction to the project.
|
||||||
@@ -10,7 +10,7 @@ The documentation source is maintained in the [docs](https://github.com/itzg/doc
|
|||||||
It will be very helpful to view the rendered documentation as you're editing. To do that run the following from the top-level directory:
|
It will be very helpful to view the rendered documentation as you're editing. To do that run the following from the top-level directory:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker compose -f compose-docs.yml -p zensical up
|
docker compose -f docker-compose-mkdocs.yml -p mkdocs up
|
||||||
```
|
```
|
||||||
|
|
||||||
You can access the live documentation rendering at <http://localhost:8000>.
|
You can access the live documentation rendering at <http://localhost:8000>.
|
||||||
@@ -27,48 +27,6 @@ services:
|
|||||||
|
|
||||||
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)
|
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)
|
||||||
|
|
||||||
|
|
||||||
## mc-router with auto-scale
|
|
||||||
|
|
||||||
Using [mc-router](https://github.com/itzg/mc-router) in front of one or multiple Minecraft server containers allows you to route players based on the hostname they use to connect.
|
|
||||||
|
|
||||||
With `AUTO_SCALE_UP` and `AUTO_SCALE_DOWN` enabled, mc-router can automatically start a target server when a player connects and stop it again after a period of inactivity.
|
|
||||||
|
|
||||||
```yaml title="compose.yaml"
|
|
||||||
services:
|
|
||||||
router:
|
|
||||||
image: itzg/mc-router
|
|
||||||
environment:
|
|
||||||
IN_DOCKER: true
|
|
||||||
AUTO_SCALE_DOWN: true
|
|
||||||
AUTO_SCALE_UP: true
|
|
||||||
AUTO_SCALE_DOWN_AFTER: 2h
|
|
||||||
AUTO_SCALE_ASLEEP_MOTD: "Server is asleep. Join again to wake it up!"
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
|
|
||||||
vanilla:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
labels:
|
|
||||||
mc-router.host: "vanilla.example.com"
|
|
||||||
|
|
||||||
paper:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: PAPER
|
|
||||||
labels:
|
|
||||||
mc-router.host: "paper.example.com"
|
|
||||||
```
|
|
||||||
|
|
||||||
[Source](https://github.com/itzg/mc-router/blob/main/examples/docker-autoscale/compose-minimal.yml)
|
|
||||||
|
|
||||||
[More detailed example](https://github.com/itzg/mc-router/blob/main/examples/docker-autoscale/compose.yml)
|
|
||||||
|
|
||||||
## Lazymc - Put your Minecraft server to rest when idle
|
## Lazymc - Put your Minecraft server to rest when idle
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|||||||
+10
-25
@@ -1,25 +1,10 @@
|
|||||||
click==8.3.1
|
mkdocs-material == 9.7.0
|
||||||
colorama==0.4.6
|
mkdocs-autorefs == 1.4.3
|
||||||
deepmerge==2.0
|
mkdocstrings[python] == 0.30.1
|
||||||
ghp-import==2.1.0
|
mkdocs-literate-nav == 0.6.2
|
||||||
griffe==1.15.0
|
mdx-gh-links == 0.4
|
||||||
Jinja2==3.1.6
|
# need to pin for auto reload to work
|
||||||
Markdown==3.10
|
# see https://github.com/mkdocs/mkdocs/issues/4032
|
||||||
MarkupSafe==3.0.3
|
click==8.2.1
|
||||||
mergedeep==1.3.4
|
mkdocs-click == 0.9.0
|
||||||
mkdocs==1.6.1
|
mkdocs-static-i18n == 1.3.0
|
||||||
mkdocs-autorefs==1.4.3
|
|
||||||
mkdocs-get-deps==0.2.0
|
|
||||||
mkdocstrings==1.0.0
|
|
||||||
mkdocstrings-python==2.0.1
|
|
||||||
packaging==25.0
|
|
||||||
pathspec==1.0.3
|
|
||||||
platformdirs==4.5.1
|
|
||||||
Pygments==2.19.2
|
|
||||||
pymdown-extensions==10.20
|
|
||||||
python-dateutil==2.9.0.post0
|
|
||||||
PyYAML==6.0.3
|
|
||||||
pyyaml_env_tag==1.1
|
|
||||||
six==1.17.0
|
|
||||||
watchdog==6.0.0
|
|
||||||
# zensical @ file:///
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
---
|
|
||||||
title: Over SSH
|
|
||||||
---
|
|
||||||
|
|
||||||
The container can host an SSH console. It is enabled by setting `ENABLE_SSH` to `true`.
|
|
||||||
The SSH server only supports password based authentication. The password is the same as the RCON password.
|
|
||||||
|
|
||||||
!!! question
|
|
||||||
See [the RCON password](../configuration/server-properties.md/#rcon-password) section under configuration/server-properties for more information on how to set an RCON password.
|
|
||||||
|
|
||||||
The SSH server runs on port `2222` inside the container.
|
|
||||||
|
|
||||||
??? tip "Tip: Exposing the SSH port"
|
|
||||||
|
|
||||||
!!! warning "Security Implications"
|
|
||||||
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the SSH console accessible to any device that can reach your host machine.
|
|
||||||
|
|
||||||
Since the SSH console grants **full administrative access** to your server, it is critical to use a strong [RCON password](../configuration/server-properties.md/#rcon-password).
|
|
||||||
|
|
||||||
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:2222:2222`).
|
|
||||||
|
|
||||||
If SSH access is only intended for inter-container connections, consider **NOT** forwarding the port to the host machine, and putting the containers in a shared [Docker network](https://docs.docker.com/engine/network/#user-defined-networks).
|
|
||||||
|
|
||||||
```yaml title="compose.yaml"
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
ports:
|
|
||||||
- '25565:25565'
|
|
||||||
- '2222:2222'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Connecting
|
|
||||||
|
|
||||||
Connecting should be as simple as running
|
|
||||||
```bash
|
|
||||||
ssh anyuser@127.0.0.1 -p 2222
|
|
||||||
```
|
|
||||||
and typing in the RCON password.
|
|
||||||
|
|
||||||
## Environment variables
|
|
||||||
|
|
||||||
| Environment Variable | Usage | Default |
|
|
||||||
| -------------------- | ------------------------- | ------- |
|
|
||||||
| `ENABLE_SSH` | Enable remote SSH console | `false` |
|
|
||||||
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```yaml title="compose.yaml"
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
image: itzg/minecraft-server:latest
|
|
||||||
pull_policy: daily
|
|
||||||
tty: true
|
|
||||||
stdin_open: true
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
- "2222:2222"
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
ENABLE_SSH: true
|
|
||||||
RCON_PASSWORD_FILE: /run/secrets/rcon_pass
|
|
||||||
volumes:
|
|
||||||
# attach the relative directory 'data' to the container's /data path
|
|
||||||
- ./data:/data
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
rcon_pass:
|
|
||||||
file: ./rcon_password
|
|
||||||
```
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: With WebSocket
|
title: With websocket
|
||||||
---
|
---
|
||||||
|
|
||||||
With `WEBSOCKET_CONSOLE` set to `true`, logs can be streamed, and commands sent, over a WebSocket connection.
|
With `WEBSOCKET_CONSOLE` set to `true`, logs can be streamed, and commands sent, over a websocket connection.
|
||||||
The API is available on `/console`.
|
The API is available on `/websocket`.
|
||||||
|
|
||||||
## Password
|
## 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`.
|
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`.
|
||||||
@@ -21,16 +21,7 @@ The listen address and port can be set with `WEBSOCKET_ADDRESS` (defaults to `0.
|
|||||||
## Log history
|
## 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.
|
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"
|
??? tip "Tip: Remember to forward the websocket port on the host"
|
||||||
|
|
||||||
!!! warning "Security Implications"
|
|
||||||
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the WebSocket console accessible to any device that can reach your host machine.
|
|
||||||
|
|
||||||
Since the WebSocket console grants **full administrative access** to your server, it is critical to use a strong [WebSocket password](#password) or [RCON password](../configuration/server-properties.md/#rcon-password).
|
|
||||||
|
|
||||||
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:80:80`).
|
|
||||||
|
|
||||||
If WebSocket access is only intended for inter-container connections, consider **NOT** forwarding the port to the host machine, and putting the containers in a shared [Docker network](https://docs.docker.com/engine/network/#user-defined-networks).
|
|
||||||
|
|
||||||
```yaml title="compose.yaml"
|
```yaml title="compose.yaml"
|
||||||
services:
|
services:
|
||||||
@@ -43,12 +34,12 @@ When a connection is established, the last 50 (by default, configurable with `WE
|
|||||||
## Environment variables
|
## Environment variables
|
||||||
| Environment Variable | Usage | Default |
|
| Environment Variable | Usage | Default |
|
||||||
| ---------------------------------- | ---------------------------------------------------------- | ------------ |
|
| ---------------------------------- | ---------------------------------------------------------- | ------------ |
|
||||||
| `WEBSOCKET_CONSOLE` | Allow remote shell over WebSocket | `false` |
|
| `WEBSOCKET_CONSOLE` | Allow remote shell over websocket | `false` |
|
||||||
| `WEBSOCKET_ADDRESS` | Bind address for WebSocket server | `0.0.0.0:80` |
|
| `WEBSOCKET_ADDRESS` | Bind address for websocket server | `0.0.0.0:80` |
|
||||||
| `WEBSOCKET_DISABLE_ORIGIN_CHECK` | Disable checking if origin is trusted | `false` |
|
| `WEBSOCKET_DISABLE_ORIGIN_CHECK` | Disable checking if origin is trusted | `false` |
|
||||||
| `WEBSOCKET_ALLOWED_ORIGINS` | Comma-separated list of trusted origins | ` ` |
|
| `WEBSOCKET_ALLOWED_ORIGINS` | Comma-separated list of trusted origins | ` ` |
|
||||||
| `WEBSOCKET_PASSWORD` | Password will be the same as RCON_PASSWORD if unset | ` ` |
|
| `WEBSOCKET_PASSWORD` | Password will be the same as RCON_PASSWORD if unset | ` ` |
|
||||||
| `WEBSOCKET_DISABLE_AUTHENTICATION` | Disable WebSocket authentication | `false` |
|
| `WEBSOCKET_DISABLE_AUTHENTICATION` | Disable websocket authentication | `false` |
|
||||||
| `WEBSOCKET_LOG_BUFFER_SIZE` | Number of log lines to save and send to connecting clients | `50` |
|
| `WEBSOCKET_LOG_BUFFER_SIZE` | Number of log lines to save and send to connecting clients | `50` |
|
||||||
|
|
||||||
## API Schema
|
## API Schema
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ Configuration options with defaults:
|
|||||||
|
|
||||||
## Set Modpack version
|
## 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 won't 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.
|
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.
|
> 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.
|
||||||
|
|
||||||
## Resource requirements
|
## Ressource requirements
|
||||||
|
|
||||||
**Recommended Minimum:**
|
**Recommended Minimum:**
|
||||||
|
|
||||||
|
|||||||
+213
-44
@@ -57,45 +57,9 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
<td><code>UTC</code></td>
|
<td><code>UTC</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td><code>LOG_LEVEL</code></td>
|
|
||||||
<td>Root logger level (trace, debug, info, warn, error)</td>
|
|
||||||
<td><code>info</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>LOG_CONSOLE_FORMAT</code></td>
|
|
||||||
<td>Log4j2 pattern for console output (what you see in <code>docker logs</code>)</td>
|
|
||||||
<td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>LOG_FILE_FORMAT</code></td>
|
|
||||||
<td>Log4j2 pattern for file logs (written to <code>logs/latest.log</code>)</td>
|
|
||||||
<td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>LOG_TERMINAL_FORMAT</code></td>
|
|
||||||
<td>Log4j2 pattern for interactive terminal console (used with <code>docker attach</code>)</td>
|
|
||||||
<td><code>[%d{HH:mm:ss} %level]: %msg%n</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>ROLLING_LOG_FILE_PATTERN</code></td>
|
|
||||||
<td>Pattern for rolled/archived log file names</td>
|
|
||||||
<td><code>logs/%d{yyyy-MM-dd}-%i.log.gz</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>ROLLING_LOG_MAX_FILES</code></td>
|
|
||||||
<td>Maximum number of archived log files to keep</td>
|
|
||||||
<td><code>1000</code></td>
|
|
||||||
<td>⬜️</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>ENABLE_ROLLING_LOGS</code></td>
|
<td><code>ENABLE_ROLLING_LOGS</code></td>
|
||||||
<td><strong>Legacy option.</strong> Rolling logs are now enabled by default via templated log4j2 configuration. This option is maintained for backward compatibility but only used for error reporting</td>
|
<td>By default the vanilla log file will grow without limit. The logger can be reconfigured to use a rolling log files strategy by setting this to <code>true</code></td>
|
||||||
<td><code>false</code></td>
|
<td><code>false</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -216,6 +180,102 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
<td><code>FALSE</code></td>
|
<td><code>FALSE</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>MAX_PLAYERS</code></td>
|
||||||
|
<td>The maximum number of players that can join the server.</td>
|
||||||
|
<td><code>20</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>MAX_WORLD_SIZE</code></td>
|
||||||
|
<td>The maximum possible size in blocks, expressed as a radius.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ALLOW_NETHER</code></td>
|
||||||
|
<td>Allows players to travel to the Nether</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ANNOUNCE_PLAYER_ACHIEVEMENTS</code></td>
|
||||||
|
<td>Allows server to announce when a player gets an achievement.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ENABLE_COMMAND_BLOCK</code></td>
|
||||||
|
<td>Enables the command blocks.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>FORCE_GAMEMODE</code></td>
|
||||||
|
<td>Force players to join in the default game mode.</td>
|
||||||
|
<td><code>false</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>GENERATE_STRUCTURES</code></td>
|
||||||
|
<td>Defines whether structures (such as villages) will be generated.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>HARDCORE</code></td>
|
||||||
|
<td>If set to <code>true</code>, players will be set to spectator mode if they die.</td>
|
||||||
|
<td><code>false</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SNOOPER_ENABLED</code></td>
|
||||||
|
<td>If set to false, the server will not send data to snoop.minecraft.net server.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>MAX_BUILD_HEIGHT</code></td>
|
||||||
|
<td>The maximum height in which building is allowed. Terrain may still naturally generate above a low height limit.</td>
|
||||||
|
<td><code>256</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SPAWN_ANIMALS</code></td>
|
||||||
|
<td>Determines if animals will be able to spawn.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SPAWN_MONSTERS</code></td>
|
||||||
|
<td>Determines if monsters will be spawned.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SPAWN_NPCS</code></td>
|
||||||
|
<td>Determines if villagers will be spawned.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SPAWN_PROTECTION</code></td>
|
||||||
|
<td>Sets the area that non-ops can not edit (0 to disable)</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>VIEW_DISTANCE</code></td>
|
||||||
|
<td>Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). It determines the server-side viewing distance.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SEED</code></td>
|
||||||
|
<td>Sets the seed to create the Minecraft world. If you use a negative number, make sure that it is in quotes.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>MODE</code></td>
|
<td><code>MODE</code></td>
|
||||||
<td>Minecraft servers are configured to run in Survival mode by default. You can change the mode using MODE where you can either provide the <a href="http://minecraft.wiki/Game_mode#Game_modes">standard numerical values</a> or the shortcut values:<br />
|
<td>Minecraft servers are configured to run in Survival mode by default. You can change the mode using MODE where you can either provide the <a href="http://minecraft.wiki/Game_mode#Game_modes">standard numerical values</a> or the shortcut values:<br />
|
||||||
@@ -228,18 +288,127 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
<td><code></code></td>
|
<td><code></code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>PVP</code></td>
|
||||||
|
<td>By default, servers are created with player-vs-player (PVP) mode enabled.</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>LEVEL_TYPE</code></td>
|
||||||
|
<td>By default, a standard world is generated with hills, valleys, water, etc. A different level type can be configured by setting LEVEL_TYPE to <a href="https://minecraft.wiki/w/Server.properties#level-type">an expected type listed here</a>.
|
||||||
|
</td>
|
||||||
|
<td><code>minecraft:default</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>GENERATOR_SETTINGS</code></td>
|
||||||
|
<td>For some of the level types, <code>GENERATOR_SETTINGS</code> can be used to further customize the world generation <a href="https://minecraft.wiki/w/Server.properties#generator-settings">as described here</a>.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>LEVEL</code></td>
|
<td><code>LEVEL</code></td>
|
||||||
<td>Maps to [the `level-name` server property](https://minecraft.wiki/w/Server.properties#level-name). You can either switch between world saves or run multiple containers with different saves by using the LEVEL option</td>
|
<td>You can either switch between world saves or run multiple containers with different saves by using the LEVEL option</td>
|
||||||
<td><code>world</code></td>
|
<td><code>world</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>SERVER_PORT</code></td>
|
<td><code>ONLINE_MODE</code></td>
|
||||||
<td>Maps to [the `server-port` server property](https://minecraft.wiki/w/Server.properties#server-port). Only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.</td>
|
<td>By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players</td>
|
||||||
|
<td><code>true</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ALLOW_FLIGHT</code></td>
|
||||||
|
<td>Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.</td>
|
||||||
|
<td><code>FALSE</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SERVER_NAME</code></td>
|
||||||
|
<td>The server name</td>
|
||||||
<td><code></code></td>
|
<td><code></code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SERVER_PORT</code></td>
|
||||||
|
<td>Only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>PLAYER_IDLE_TIMEOUT</code></td>
|
||||||
|
<td>player-idle-timeout</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ENABLE_JMX</code></td>
|
||||||
|
<td>enable-jmx-monitoring</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SYNC_CHUNK_WRITES</code></td>
|
||||||
|
<td>sync-chunk-writes</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ENABLE_STATUS</code></td>
|
||||||
|
<td>enable-status</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>ENTITY_BROADCAST_RANGE_PERCENTAGE</code></td>
|
||||||
|
<td>entity-broadcast-range-percentage</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>FUNCTION_PERMISSION_LEVEL</code></td>
|
||||||
|
<td>function-permission-level</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>NETWORK_COMPRESSION_THRESHOLD</code></td>
|
||||||
|
<td>network-compression-threshold</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>OP_PERMISSION_LEVEL</code></td>
|
||||||
|
<td>op-permission-level</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>PREVENT_PROXY_CONNECTIONS</code></td>
|
||||||
|
<td>prevent-proxy-connections</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>USE_NATIVE_TRANSPORT</code></td>
|
||||||
|
<td>use-native-transport</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>SIMULATION_DISTANCE</code></td>
|
||||||
|
<td>simulation-distance</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXEC_DIRECTLY</code></td>
|
||||||
|
<td>If you would like to docker attach to the Minecraft server console with color and interactive capabilities, then set to <code>true</code></td>
|
||||||
|
<td><code>false</code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>STOP_SERVER_ANNOUNCE_DELAY</code></td>
|
<td><code>STOP_SERVER_ANNOUNCE_DELAY</code></td>
|
||||||
<td>To allow time for players to finish what they're doing during a graceful server shutdown, set <code>STOP_SERVER_ANNOUNCE_DELAY</code> to a number of seconds to delay after an announcement is posted by the server.</td>
|
<td>To allow time for players to finish what they're doing during a graceful server shutdown, set <code>STOP_SERVER_ANNOUNCE_DELAY</code> to a number of seconds to delay after an announcement is posted by the server.</td>
|
||||||
@@ -297,10 +466,6 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
### Server properties
|
|
||||||
|
|
||||||
This image maps known server properties as described in [this section](configuration/server-properties.md).
|
|
||||||
|
|
||||||
### Custom resource pack
|
### Custom resource pack
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@@ -444,6 +609,10 @@ This image maps known server properties as described in [this section](configura
|
|||||||
|
|
||||||
### Auto-Pause
|
### Auto-Pause
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
|
||||||
|
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -12,17 +12,17 @@ where `<tag>` refers to the first column of this table:
|
|||||||
|
|
||||||
| Tag | Java version | Linux | JVM Type | Architecture | Note |
|
| Tag | Java version | Linux | JVM Type | Architecture | Note |
|
||||||
|----------------|--------------|--------|--------------------|---------------------|------|
|
|----------------|--------------|--------|--------------------|---------------------|------|
|
||||||
| latest | 25 | Ubuntu | Hotspot | amd64, arm64 | |
|
| latest | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||||
| stable | 25 | Ubuntu | Hotspot | amd64, arm64 | |
|
| stable | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||||
| java25 | 25 | Ubuntu | Hotspot | amd64, arm64 | |
|
| java25 | 25 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||||
| java25-jdk | 25 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
| java25-jdk | 25 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
||||||
| java25-graalvm | 25 | Oracle | Oracle GraalVM (3) | amd64, arm64 | (5) |
|
| java25-graalvm | 25 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||||
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 | |
|
||||||
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 | |
|
||||||
| java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 | |
|
| java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 | |
|
||||||
| java21-graalvm | 21 | Oracle | Oracle GraalVM (3) | amd64, arm64 | (5) |
|
| java21-graalvm | 21 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||||
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||||
| java17-graalvm | 17 | Oracle | Oracle GraalVM (3) | amd64, arm64 | (5) |
|
| java17-graalvm | 17 | Oracle | Oracle GraalVM (3) | amd64, arm64 | |
|
||||||
| java16 | 16 | Ubuntu | Hotspot | amd64, arm64, armv7 | (4) |
|
| java16 | 16 | Ubuntu | Hotspot | amd64, arm64, armv7 | (4) |
|
||||||
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||||
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | |
|
||||||
@@ -33,7 +33,6 @@ Notes
|
|||||||
2. Short-term variant, subject to deprecation upon next version introduction
|
2. Short-term variant, subject to deprecation upon next version introduction
|
||||||
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.
|
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)
|
4. This version of Java is [recommended for PaperMC 1.16.5](https://docs.papermc.io/paper/getting-started/#requirements)
|
||||||
5. Due to these images using Oracle Linux, (which is based on Red Hat Enterprise Linux) Forge Installer will not work due to its use of zlib-ng. Use other images for initial installation and Forge version upgrade.
|
|
||||||
|
|
||||||
!!! example "Example using java8"
|
!!! example "Example using java8"
|
||||||
|
|
||||||
@@ -145,5 +144,4 @@ The following image tags have been deprecated and are no longer receiving update
|
|||||||
|
|
||||||
## JSON Listing
|
## JSON Listing
|
||||||
|
|
||||||
|
Information about the image tags is available for programmatic access 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>
|
|
||||||
@@ -110,20 +110,9 @@ services:
|
|||||||
####################################################################
|
####################################################################
|
||||||
# Logging Options #
|
# Logging Options #
|
||||||
# #
|
# #
|
||||||
# Rolling logs are now enabled by default with templated #
|
# Set to "true" to delete old logs #
|
||||||
# log4j2 configuration. You can customize: #
|
|
||||||
# #
|
|
||||||
# LOG_LEVEL: Log level (default: info) #
|
|
||||||
# LOG_CONSOLE_FORMAT: Console output format (docker logs) #
|
|
||||||
# LOG_FILE_FORMAT: File log format (logs/latest.log) #
|
|
||||||
# ROLLING_LOG_MAX_FILES: Max archived files (default: 1000) #
|
|
||||||
# #
|
|
||||||
# Example: Add full timestamp to logs #
|
|
||||||
# LOG_CONSOLE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n"
|
|
||||||
# LOG_FILE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n"
|
|
||||||
# #
|
|
||||||
# ENABLE_ROLLING_LOGS is now legacy and no longer needed. #
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
ENABLE_ROLLING_LOGS: "true"
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Server Timezone #
|
# Server Timezone #
|
||||||
|
|||||||
@@ -120,20 +120,9 @@ services:
|
|||||||
####################################################################
|
####################################################################
|
||||||
# Logging Options #
|
# Logging Options #
|
||||||
# #
|
# #
|
||||||
# Rolling logs are now enabled by default with templated #
|
# Set to "true" to delete old logs #
|
||||||
# log4j2 configuration. You can customize: #
|
|
||||||
# #
|
|
||||||
# LOG_LEVEL: Log level (default: info) #
|
|
||||||
# LOG_CONSOLE_FORMAT: Console output format (docker logs) #
|
|
||||||
# LOG_FILE_FORMAT: File log format (logs/latest.log) #
|
|
||||||
# ROLLING_LOG_MAX_FILES: Max archived files (default: 1000) #
|
|
||||||
# #
|
|
||||||
# Example: Add full timestamp to logs #
|
|
||||||
# LOG_CONSOLE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n"
|
|
||||||
# LOG_FILE_FORMAT: "[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n"
|
|
||||||
# #
|
|
||||||
# ENABLE_ROLLING_LOGS is now legacy and no longer needed. #
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
ENABLE_ROLLING_LOGS: "true"
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Server Timezone #
|
# Server Timezone #
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
services:
|
|
||||||
mc:
|
|
||||||
image: itzg/minecraft-server:java25
|
|
||||||
tty: true
|
|
||||||
stdin_open: true
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: FTBA
|
|
||||||
FTB_MODPACK_ID: "130"
|
|
||||||
FTB_MODPACK_VERSION_ID: "100171"
|
|
||||||
MEMORY: "4G"
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
volumes:
|
|
||||||
- data:/data
|
|
||||||
volumes:
|
|
||||||
data:
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# Source: https://github.com/itzg/mc-router/blob/main/examples/docker-autoscale/compose-minimal.yml
|
|
||||||
services:
|
|
||||||
router:
|
|
||||||
image: itzg/mc-router
|
|
||||||
environment:
|
|
||||||
IN_DOCKER: true
|
|
||||||
AUTO_SCALE_DOWN: true
|
|
||||||
AUTO_SCALE_UP: true
|
|
||||||
AUTO_SCALE_DOWN_AFTER: 2h
|
|
||||||
AUTO_SCALE_ASLEEP_MOTD: "Server is asleep. Join again to wake it up!"
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
vanilla:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
labels:
|
|
||||||
mc-router.host: "vanilla.example.com"
|
|
||||||
paper:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: PAPER
|
|
||||||
labels:
|
|
||||||
mc-router.host: "paper.example.com"
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
# Source: https://github.com/itzg/mc-router/blob/main/examples/docker-autoscale/compose.yml
|
|
||||||
# This is a verbose example with comments and explanations for configuring auto-scaling behavior
|
|
||||||
# for Docker backend servers. See compose-minimal.yml for a simple minimal example.
|
|
||||||
services:
|
|
||||||
router:
|
|
||||||
image: itzg/mc-router
|
|
||||||
environment:
|
|
||||||
IN_DOCKER: true
|
|
||||||
# Global auto-scaling settings for all docker-backend servers
|
|
||||||
# Settings can be overridden per-backend using labels
|
|
||||||
# as shown in the backend services below (except for AUTO_SCALE_DOWN_AFTER which is global only)
|
|
||||||
# Enable auto-scaling down after inactivity for all backends by default
|
|
||||||
AUTO_SCALE_DOWN: true
|
|
||||||
# Enable auto-scaling up after player join for all backends by default
|
|
||||||
AUTO_SCALE_UP: true
|
|
||||||
# Time of inactivity after which to scale down (default: 10m) - Global only setting
|
|
||||||
AUTO_SCALE_DOWN_AFTER: 2h
|
|
||||||
# MOTD to show when server is asleep (default: empty string - don't show MOTD, show server offline instead)
|
|
||||||
AUTO_SCALE_ASLEEP_MOTD: "Server is asleep. Join again to wake it up!"
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
vanilla:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
labels:
|
|
||||||
# If global auto scaling settings are enabled, this backend will
|
|
||||||
# auto-scale without any additional auto-scale related configuration
|
|
||||||
mc-router.host: "vanilla.example.com"
|
|
||||||
fabric:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: FABRIC
|
|
||||||
labels:
|
|
||||||
mc-router.host: "fabric.example.com"
|
|
||||||
# Disable auto-scaling for this backend specifically
|
|
||||||
mc-router.auto-scale-up: false
|
|
||||||
mc-router.auto-scale-down: false
|
|
||||||
paper:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: PAPER
|
|
||||||
labels:
|
|
||||||
mc-router.host: "paper.example.com"
|
|
||||||
# Override asleep MOTD for this backend
|
|
||||||
mc-router.auto-scale-asleep-motd: "Paper is folded. Join to unfold!"
|
|
||||||
@@ -35,7 +35,6 @@
|
|||||||
"controllable",
|
"controllable",
|
||||||
"controlling",
|
"controlling",
|
||||||
"craftpresence",
|
"craftpresence",
|
||||||
"crash-assistant",
|
|
||||||
"cull-less-leaves",
|
"cull-less-leaves",
|
||||||
"ctm",
|
"ctm",
|
||||||
"custom-main-menu",
|
"custom-main-menu",
|
||||||
@@ -101,7 +100,6 @@
|
|||||||
"lootbeams",
|
"lootbeams",
|
||||||
"magnesium-extras",
|
"magnesium-extras",
|
||||||
"make-bubbles-pop",
|
"make-bubbles-pop",
|
||||||
"mekalus-oculus-fork-with-fixed-mekanism-mekasuit",
|
|
||||||
"menumobs",
|
"menumobs",
|
||||||
"minecraft-rich-presence",
|
"minecraft-rich-presence",
|
||||||
"mining-speed-tooltips",
|
"mining-speed-tooltips",
|
||||||
@@ -185,10 +183,7 @@
|
|||||||
"forceIncludes": ["just-enough-resources-jer"]
|
"forceIncludes": ["just-enough-resources-jer"]
|
||||||
},
|
},
|
||||||
"ftb-stoneblock-4": {
|
"ftb-stoneblock-4": {
|
||||||
"forceIncludes": [
|
"forceIncludes": ["particular-reforged"]
|
||||||
"particular-reforged",
|
|
||||||
"ctm"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"mc-eternal-2": {
|
"mc-eternal-2": {
|
||||||
"forceIncludes": [
|
"forceIncludes": [
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration status="WARN">
|
||||||
|
<Appenders>
|
||||||
|
<Console name="SysOut" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||||
|
</Console>
|
||||||
|
<Queue name="TerminalConsole">
|
||||||
|
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss} %level]: %msg%n" />
|
||||||
|
</Queue>
|
||||||
|
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||||
|
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||||
|
<Policies>
|
||||||
|
<!-- Based on filePattern resolution, so daily -->
|
||||||
|
<TimeBasedTriggeringPolicy />
|
||||||
|
<SizeBasedTriggeringPolicy size="100 MB" />
|
||||||
|
<OnStartupTriggeringPolicy />
|
||||||
|
</Policies>
|
||||||
|
<DefaultRolloverStrategy>
|
||||||
|
<Delete basePath="logs">
|
||||||
|
<IfFileName glob="*.log.gz" />
|
||||||
|
<IfLastModified age="7d" />
|
||||||
|
<IfAccumulatedFileCount exceeds="20"/>
|
||||||
|
</Delete>
|
||||||
|
</DefaultRolloverStrategy>
|
||||||
|
</RollingRandomAccessFile>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<Root level="info">
|
||||||
|
<filters>
|
||||||
|
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
||||||
|
</filters>
|
||||||
|
<AppenderRef ref="SysOut"/>
|
||||||
|
<AppenderRef ref="File"/>
|
||||||
|
<AppenderRef ref="TerminalConsole"/>
|
||||||
|
</Root>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
||||||
@@ -32,7 +32,6 @@
|
|||||||
"continuity",
|
"continuity",
|
||||||
"controlling",
|
"controlling",
|
||||||
"craftpresence",
|
"craftpresence",
|
||||||
"CrashAssistant",
|
|
||||||
"Cull Less Leaves",
|
"Cull Less Leaves",
|
||||||
"cwb",
|
"cwb",
|
||||||
"DisableCustomWorldsAdvice",
|
"DisableCustomWorldsAdvice",
|
||||||
|
|||||||
+95
@@ -0,0 +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 © 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
|
||||||
@@ -28,11 +28,7 @@ shopt -s nullglob
|
|||||||
|
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
if (( $(mc-image-helper java-release) >= 17 )); then
|
#umask 002
|
||||||
MC_IMAGE_HELPER_OPTS+=" --enable-native-access=ALL-UNNAMED"
|
|
||||||
export MC_IMAGE_HELPER_OPTS
|
|
||||||
fi
|
|
||||||
|
|
||||||
export HOME=/data
|
export HOME=/data
|
||||||
|
|
||||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||||
@@ -95,6 +91,11 @@ fi
|
|||||||
##########################################
|
##########################################
|
||||||
# Auto-pause/stop
|
# Auto-pause/stop
|
||||||
|
|
||||||
|
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||||
|
logError "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
|
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
|
||||||
logError "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true"
|
logError "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -321,7 +322,7 @@ case "${TYPE^^}" in
|
|||||||
logError "Invalid TYPE: '$TYPE'"
|
logError "Invalid TYPE: '$TYPE'"
|
||||||
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
|
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
|
||||||
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH,"
|
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, GTNH, AIRPLANE, PUFFERFISH,"
|
||||||
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER, NEOFORGE"
|
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ if isTrue "$FTB_FORCE_REINSTALL" ||
|
|||||||
|
|
||||||
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
|
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
|
||||||
log "This could take a while..."
|
log "This could take a while..."
|
||||||
${ftbInstaller} -pack "${FTB_MODPACK_ID}" -version "${FTB_MODPACK_VERSION_ID}" -auto -force -no-java | tee ftb-installer.log
|
${ftbInstaller} -pack "${FTB_MODPACK_ID}" -version "${FTB_MODPACK_VERSION_ID}" -auto -force | tee ftb-installer.log
|
||||||
rm -f forge*installer.jar
|
rm -f forge*installer.jar
|
||||||
|
|
||||||
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
: "${FOLIA_CHANNEL:=default}"
|
: "${FOLIA_CHANNEL:=experimental}"
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
# shellcheck source=start-utils
|
||||||
. "$(dirname "$0")/start-utils"
|
. "$(dirname "$0")/start-utils"
|
||||||
|
|||||||
+26
-75
@@ -47,7 +47,7 @@ if [ -n "$ICON" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
useGeneratedLogs=${GENERATE_LOG4J2_CONFIG:-${ENABLE_ROLLING_LOGS:-false}}
|
canUseRollingLogs=true
|
||||||
useFallbackJvmFlag=false
|
useFallbackJvmFlag=false
|
||||||
|
|
||||||
SERVER_DIR="$baseDataDir"
|
SERVER_DIR="$baseDataDir"
|
||||||
@@ -65,7 +65,7 @@ patchLog4jConfig() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
|
||||||
useGeneratedLogs=false
|
canUseRollingLogs=false
|
||||||
}
|
}
|
||||||
|
|
||||||
# Temporarily disable debugging output
|
# Temporarily disable debugging output
|
||||||
@@ -103,77 +103,20 @@ elif versionLessThan 1.18.1; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up log4j2 configuration with templating support
|
if isTrue "${ENABLE_ROLLING_LOGS:-false}"; then
|
||||||
LOGFILE="${SERVER_DIR}/log4j2.xml"
|
if ! ${canUseRollingLogs}; then
|
||||||
if ${useGeneratedLogs}; then
|
logError "Using rolling logs is currently not possible in the selected version due to CVE-2021-44228"
|
||||||
# Set up log configuration defaults
|
exit 1
|
||||||
: "${LOG_LEVEL:=info}"
|
|
||||||
: "${ROLLING_LOG_MAX_FILES:=1000}"
|
|
||||||
# Note: Can't use ${VAR:=default} syntax for values containing } as it breaks parsing
|
|
||||||
if [ -z "${ROLLING_LOG_FILE_PATTERN}" ]; then
|
|
||||||
ROLLING_LOG_FILE_PATTERN='logs/%d{yyyy-MM-dd}-%i.log.gz'
|
|
||||||
fi
|
fi
|
||||||
|
# Set up log configuration
|
||||||
# Pattern format defaults (compatible with vanilla Minecraft)
|
LOGFILE="${SERVER_DIR}/log4j2.xml"
|
||||||
# Note: Can't use ${VAR:=default} syntax because } in the value breaks parsing
|
if [ ! -e "$LOGFILE" ]; then
|
||||||
if [ -z "${LOG_CONSOLE_FORMAT}" ]; then
|
log "Creating log4j2.xml in ${LOGFILE}"
|
||||||
LOG_CONSOLE_FORMAT='[%d{HH:mm:ss}] [%t/%level]: %msg%n'
|
cp /image/log4j2.xml "$LOGFILE"
|
||||||
fi
|
|
||||||
if [ -z "${LOG_TERMINAL_FORMAT}" ]; then
|
|
||||||
LOG_TERMINAL_FORMAT='[%d{HH:mm:ss} %level]: %msg%n'
|
|
||||||
fi
|
|
||||||
if [ -z "${LOG_FILE_FORMAT}" ]; then
|
|
||||||
LOG_FILE_FORMAT='[%d{HH:mm:ss}] [%t/%level]: %msg%n'
|
|
||||||
fi
|
|
||||||
|
|
||||||
export LOG_LEVEL ROLLING_LOG_FILE_PATTERN ROLLING_LOG_MAX_FILES
|
|
||||||
export LOG_CONSOLE_FORMAT LOG_TERMINAL_FORMAT LOG_FILE_FORMAT
|
|
||||||
|
|
||||||
|
|
||||||
# Always regenerate if file doesn't exist
|
|
||||||
if [ ! -e "$LOGFILE" ] || isTrue "${REGENERATE_LOG4J2:-true}"; then
|
|
||||||
log "Generating log4j2.xml from template in ${LOGFILE}"
|
|
||||||
|
|
||||||
# Generate log4j2.xml using heredoc for reliable variable substitution
|
|
||||||
cat > "$LOGFILE" <<EOF
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Configuration status="WARN">
|
|
||||||
<Appenders>
|
|
||||||
<Console name="SysOut" target="SYSTEM_OUT">
|
|
||||||
<PatternLayout pattern="${LOG_CONSOLE_FORMAT}" />
|
|
||||||
</Console>
|
|
||||||
<Queue name="TerminalConsole">
|
|
||||||
<PatternLayout pattern="${LOG_TERMINAL_FORMAT}" />
|
|
||||||
</Queue>
|
|
||||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="${ROLLING_LOG_FILE_PATTERN}">
|
|
||||||
<PatternLayout pattern="${LOG_FILE_FORMAT}" />
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy />
|
|
||||||
<OnStartupTriggeringPolicy />
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="${ROLLING_LOG_MAX_FILES}"/>
|
|
||||||
</RollingRandomAccessFile>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="${LOG_LEVEL}">
|
|
||||||
<filters>
|
|
||||||
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
|
||||||
</filters>
|
|
||||||
<AppenderRef ref="SysOut"/>
|
|
||||||
<AppenderRef ref="File"/>
|
|
||||||
<AppenderRef ref="TerminalConsole"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
||||||
EOF
|
|
||||||
else
|
else
|
||||||
log "log4j2.xml already exists and is up to date, skipping generation"
|
log "log4j2.xml already created, skipping"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply the log4j2 configuration
|
|
||||||
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
|
||||||
else
|
|
||||||
rm -f "${LOGFILE}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional disable console
|
# Optional disable console
|
||||||
@@ -542,12 +485,16 @@ fi
|
|||||||
if isTrue "${DEBUG_EXEC}"; then
|
if isTrue "${DEBUG_EXEC}"; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
if [ -f "${FTB_DIR}/variables.txt" ]; then
|
if isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||||
JVM_ARGS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
|
"${finalArgs[@]}"
|
||||||
JVM_ARGS=${JVM_ARGS//$'\n'/}
|
else
|
||||||
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
|
if [ -f "${FTB_DIR}/variables.txt" ]; then
|
||||||
|
JVM_ARGS="${JVM_XX_OPTS} ${JVM_OPTS} $expandedDOpts"
|
||||||
|
JVM_ARGS=${JVM_ARGS//$'\n'/}
|
||||||
|
sed -i "s~JAVA_ARGS=.*~JAVA_ARGS=\"${JVM_ARGS}\"~" "${FTB_DIR}/variables.txt"
|
||||||
|
fi
|
||||||
|
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
|
||||||
fi
|
fi
|
||||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
|
|
||||||
elif [[ $SERVER =~ run.sh ]]; then
|
elif [[ $SERVER =~ run.sh ]]; then
|
||||||
log "Using Forge supplied run.sh script..."
|
log "Using Forge supplied run.sh script..."
|
||||||
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
|
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
|
||||||
@@ -596,5 +543,9 @@ else
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
|
if isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||||
|
exec java "${finalArgs[@]}"
|
||||||
|
else
|
||||||
|
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ set -e -o pipefail
|
|||||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
||||||
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
||||||
: "${MODRINTH_LOADER:=}"
|
: "${MODRINTH_LOADER:=}"
|
||||||
|
sum_file=/data/.generic_pack.sum
|
||||||
# shellcheck source=start-utils
|
|
||||||
. "$(dirname "$0")/start-utils"
|
|
||||||
isDebugging && set -x
|
|
||||||
|
|
||||||
if [[ -n ${CF_API_KEY_FILE} ]]; then
|
if [[ -n ${CF_API_KEY_FILE} ]]; then
|
||||||
if [[ -r "${CF_API_KEY_FILE}" ]]; then
|
if [[ -r "${CF_API_KEY_FILE}" ]]; then
|
||||||
@@ -26,7 +23,13 @@ if [[ -n ${CF_API_KEY_FILE} ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sum_file=/data/.generic_pack.sum
|
# shellcheck source=start-utils
|
||||||
|
. "$(dirname "$0")/start-utils"
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
# CURSE_URL_BASE used in manifest downloads below
|
||||||
|
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||||
|
|
||||||
# Remove old mods/plugins
|
# Remove old mods/plugins
|
||||||
if isTrue "${REMOVE_OLD_MODS}" && [ -z "${MODS_FILE}" ]; then
|
if isTrue "${REMOVE_OLD_MODS}" && [ -z "${MODS_FILE}" ]; then
|
||||||
removeOldMods "$MODS_OUT_DIR"
|
removeOldMods "$MODS_OUT_DIR"
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
[project]
|
|
||||||
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_name = "itzg/docker-minecraft-server"
|
|
||||||
repo_url = "https://github.com/itzg/docker-minecraft-server"
|
|
||||||
site_author = "itzg"
|
|
||||||
copyright = "Copyright © itzg 2026."
|
|
||||||
docs_dir = "docs"
|
|
||||||
site_dir = "site"
|
|
||||||
|
|
||||||
[project.theme]
|
|
||||||
features = [
|
|
||||||
"navigation.tracking",
|
|
||||||
"navigation.tabs",
|
|
||||||
"navigation.tabs.sticky",
|
|
||||||
"navigation.sections",
|
|
||||||
"navigation.expand",
|
|
||||||
"navigation.top",
|
|
||||||
"navigation.indexes"
|
|
||||||
]
|
|
||||||
language = "en"
|
|
||||||
|
|
||||||
[project.theme.icon]
|
|
||||||
repo = "fontawesome/brands/github"
|
|
||||||
|
|
||||||
[[project.theme.palette]]
|
|
||||||
media = "(prefers-color-scheme)"
|
|
||||||
toggle.icon = "lucide/sun-moon"
|
|
||||||
toggle.name = "Switch to light mode"
|
|
||||||
|
|
||||||
[[project.theme.palette]]
|
|
||||||
media = "(prefers-color-scheme: light)"
|
|
||||||
scheme = "default"
|
|
||||||
toggle.icon = "lucide/sun"
|
|
||||||
toggle.name = "Switch to dark mode"
|
|
||||||
|
|
||||||
[[project.theme.palette]]
|
|
||||||
media = "(prefers-color-scheme: dark)"
|
|
||||||
scheme = "slate"
|
|
||||||
toggle.icon = "lucide/moon"
|
|
||||||
toggle.name = "Switch to light mode"
|
|
||||||
Reference in New Issue
Block a user