Compare commits

..

24 Commits

Author SHA1 Message Date
Geoff Bourne
730c228d48 build: use libcap package for Alpine images (#2644) 2024-02-07 19:37:27 -06:00
Geoff Bourne
b48a252dd6 Support NeoForge for Modrinth modpacks (#2643) 2024-02-07 17:10:18 -06:00
David Whittam
f9dd0f45ab Minor spelling fix in auto-curseforge.md (#2642) 2024-02-07 13:55:15 -06:00
Geoff Bourne
9c0aa776cd docs: clarified that auto CurseForge manual downloads need a browser (#2639) 2024-02-06 12:04:50 -06:00
dependabot[bot]
69eb7488e0 build(deps): bump the updates group with 1 update (#2636) 2024-02-05 09:00:48 -06:00
dependabot[bot]
93af5297fc build(deps): bump the patches group in /docs with 1 update (#2635) 2024-02-05 07:25:06 -06:00
Geoff Bourne
629156e1b3 auto-cf: provide option to force reinstall modpack's modloader (#2633) 2024-02-04 18:57:04 -06:00
Geoff Bourne
5c0b449c79 docs: improve memory limit examples (#2634) 2024-02-04 18:48:04 -06:00
Geoff Bourne
c424dc0c47 docs: clarify new default behavior with interactive console and colorized logs (#2632) 2024-02-04 15:47:13 -06:00
Geoff Bourne
8222a79bf4 docs: add example of Paper running with PROXY protocol enabled (#2629) 2024-02-03 19:38:44 -06:00
Geoff Bourne
6ae59e61fa Support 1.20.3 change to ping description structure (#2628) 2024-02-03 16:32:17 -06:00
Geoff Bourne
63b2e4484d Apply cap_net_raw to knockd to allow rootless auto-pause (#2625) 2024-02-02 22:23:07 -06:00
Geoff Bourne
600472d7eb docs: fixed formatting of deprecated Java version list (#2622) 2024-02-02 19:31:51 -06:00
Talesu
1e2024e8db Added Velocity to Multi Server (#2623) 2024-02-02 07:57:11 -06:00
Geoff Bourne
c2f41a48ef docs: clarified the Oracle GraalVM version used (#2621) 2024-01-31 16:53:13 -06:00
Zyztem
664b66dbb7 Update the doc's Copyright year (#2620) 2024-01-31 12:06:17 -06:00
Geoff Bourne
52351a423a docs: fix mkdocs emoji and static-i18n version (#2619) 2024-01-30 18:38:56 -06:00
Geoff Bourne
e23c73c83e docs: remove the deprecated content from the README (#2618) 2024-01-30 17:35:44 -06:00
dependabot[bot]
90ea47b792 build(deps): bump the patches group in /docs with 2 updates (#2615) 2024-01-29 12:35:15 -06:00
Geoff Bourne
6ea7d5851d modrinth: report error when project version not available for requested constraints (#2614) 2024-01-27 15:07:25 -06:00
dependabot[bot]
161ca91ab3 build(deps): bump the patches group in /docs with 1 update (#2608) 2024-01-22 07:36:07 -06:00
Geoff Bourne
619cee5ae5 docs: clarify that disabling RCON disables other features (#2607) 2024-01-21 12:21:40 -06:00
Geoff Bourne
b73fb88b3b Handle I/O timout type errors from autopause mc-monitor call (#2606) 2024-01-20 19:07:58 -06:00
Geoff Bourne
ca393c4fcf Directly attach stdin of server process by default (#2605) 2024-01-20 13:13:26 -06:00
27 changed files with 358 additions and 2031 deletions

View File

@@ -39,37 +39,37 @@ jobs:
- variant: java21-graalvm
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol8
platforms: linux/amd64,linux/arm64
mcVersion: 1.20.2
mcVersion: latest
- variant: java21
baseImage: eclipse-temurin:21-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.19.3
mcVersion: latest
- variant: java21-alpine
baseImage: eclipse-temurin:21-jre-alpine
platforms: linux/amd64
mcVersion: 1.19.3
mcVersion: latest
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
mcVersion: latest
- variant: java17-graalvm
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol8
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
mcVersion: latest
- variant: java17-jdk
baseImage: eclipse-temurin:17-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
mcVersion: latest
- variant: java17-openj9
baseImage: ibm-semeru-runtimes:open-17-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
mcVersion: latest
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.18.2
mcVersion: latest
# JAVA 11:
- variant: java11
baseImage: adoptopenjdk:11-jre-hotspot
@@ -118,7 +118,7 @@ jobs:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.5.0
uses: docker/metadata-action@v5.5.1
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.

View File

@@ -25,17 +25,17 @@ jobs:
- variant: java21
baseImage: eclipse-temurin:21-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.19.4
mcVersion: latest
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64
mcVersion: 1.19.4
mcVersion: latest
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.19.4
mcVersion: latest
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64

View File

@@ -39,17 +39,17 @@ 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.12.6
ARG MC_MONITOR_VERSION=0.12.8
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.10.0
ARG MC_SERVER_RUNNER_VERSION=1.11.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.37.8
ARG MC_HELPER_VERSION=1.37.11
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

1943
README.md

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,11 @@
. "/start-utils"
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if isFalse "${CREATE_CONSOLE_IN_PIPE:-false}"; then
echo "ERROR: console pipe needs to be enabled by setting CREATE_CONSOLE_IN_PIPE to true"
fi
if [ $# = 0 ]; then
echo "ERROR: pass console commands as arguments"
exit 1

View File

@@ -26,9 +26,11 @@ apk add --no-cache -U \
zstd \
nfs-utils \
libpcap \
libwebp
libwebp \
libcap
# Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.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
setcap cap_net_raw=ep /usr/local/sbin/knockd

View File

@@ -46,3 +46,4 @@ bash /build/ol/install-gosu.sh
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
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd

View File

@@ -35,4 +35,5 @@ apt-get clean
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
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;

View File

@@ -8,13 +8,47 @@ By default, the image declares an initial and maximum Java memory-heap limit of
- `INIT_MEMORY`: independently sets the initial heap size
- `MAX_MEMORY`: independently sets the max heap size
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`. For example:
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`.
-e MEMORY=2G
!!! example "Using docker run"
```
-e MEMORY=2G
```
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 2GB of memory:
or to use init and max memory:
-e MEMORY="" -e JVM_XX_OPTS="-XX:MaxRAMPercentage=75" -m 2000M
```
-e INIT_MEMORY=1G -e MAX_MEMORY=4G
```
!!! example "Using compose file"
```
environment:
MEMORY: 2G
```
or to use init and max memory:
```
environment:
INIT_MEMORY: 1G
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:
limits:
memory: 4G
```
!!! 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).

View File

@@ -41,21 +41,9 @@ See [Custom worlds directory path](../misc/world-data.md#custom-worlds-directory
## Interactive and Color Console
If you would like to `docker attach` to the Minecraft server console with color and interactive capabilities, then add
When RCON is enabled, which is the default, and [TTY](https://docs.docker.com/compose/compose-file/05-services/#tty) is enabled on the container, then some server types will output colorized logs and provide a fully interactive console. To access the interactive console, use [`docker attach`](https://docs.docker.com/engine/reference/commandline/container_attach/) (not `exec`). When finished, make sure to use the sequence Control-P, Control-Q to detach without stopping the container.
```
-e EXEC_DIRECTLY=true
```
> **NOTES**
>
> This feature doesn't work via rcon, so you will need to `docker attach` to the container. Use the sequence Ctrl-P, Ctrl-Q to detach.
>
> This will bypass graceful server shutdown handling when using `docker stop`, so be sure the server console's `stop` command.
>
> Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose.
>
> This feature is incompatible with Autopause and cannot be set when `ENABLE_AUTOPAUSE=true`.
If this behavior interferes with the log content, then disable TTY or remove the setting entirely since the default is disabled. In a compose file, set the service's `tty` parameter to `false`. On the `docker run` command-line remove the `-t` argument.
## Server Shutdown Options

View File

@@ -187,9 +187,13 @@ The server icon which has been set doesn't get overridden by default. It can be
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".
The default password is randomly generated if `RCON_PASSWORD` has not been set.
!!! warning
**DO NOT MAP THE RCON PORT EXTERNALLY** unless you aware of all the consequences and have set a **secure password** with `RCON_PASSWORD`.
Disabling RCON will remove and limit some features, such as interactive and color console support.
The default password is randomly generated on each startup; however, a specific one can be set with `RCON_PASSWORD`.
**DO NOT MAP THE RCON PORT EXTERNALLY** unless you are aware of all the consequences and have set a **secure password** with `RCON_PASSWORD`.
!!! info

View File

@@ -1,6 +1,5 @@
mkdocs == 1.5.3
mkdocs-material-extensions == 1.3.1
mkdocs-material == 9.5.3
mkdocs-material == 9.5.7
mkdocs-autorefs == 0.5.0
mkdocstrings == 0.24.0
mkdocs-literate-nav == 0.6.1

View File

@@ -86,9 +86,9 @@ The following examples all refer to version 1.0.7 of ATM8:
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.
!!! note "Mods need download report"
!!! warning "Download using a browser"
A file called `MODS_NEED_DOWNLOAD.txt` will be created in the `/data` directory that lists the mods that need to be manually downloaded and where to get them.
It's important to use a browser to download the files listed for manual download. If your Docker host is running without a graphical interface, then you can use `scp` or similar to transfer the files to it.
!!! example
@@ -97,7 +97,7 @@ For mod, modpacks, and world files that are not allowed for automated download,
1. Create a directory next to the `docker-compose.yml` 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 composwe up -d` to apply the changes
4. Re-run `docker compose up -d` to apply the changes
```yaml
volumes:
@@ -106,7 +106,7 @@ For mod, modpacks, and world files that are not allowed for automated download,
## Unpublished Modpacks
If you wish to use a unpublished modpack zip, set the container path to the file in `CF_MODPACK_ZIP`. Similarly, the container path to a modpack manifest JSON can be passed to `CF_MODPACK_MANIFEST`. In either case, **the modpack slug or page URL must still be provided**.
If you wish to use an unpublished modpack zip, set the container path to the file in `CF_MODPACK_ZIP`. Similarly, the container path to a modpack manifest JSON can be passed to `CF_MODPACK_MANIFEST`. In either case, **the modpack slug or page URL must still be provided**.
!!! example
@@ -215,3 +215,4 @@ Some modpacks come with world/save data via a worlds file and/or the overrides p
Other configuration available:
- `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform
- `CF_OVERRIDES_SKIP_EXISTING` (default is false): if set, files in the overrides that already exist in the data directory are skipped. **NOTE** world data is always skipped, if present.
- `CF_FORCE_REINSTALL_MODLOADER` (default is false): this can be set to `true` to force the modpack's declared modloader, such as Forge, to be reinstalled. This is useful if some of the modloader's files become corrupted.

View File

@@ -540,7 +540,7 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<tbody>
<tr>
<td><code>ENABLE_RCON</code></td>
<td>Should RCON be enabled</td>
<td>Enable/disable RCON support; however, be aware that disabling RCON will remove and limit some features, such as interactive and color console support.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>

View File

@@ -13,26 +13,26 @@
When using the image `itzg/minecraft-server` without a tag, the `latest` image tag is implied from the table below. To use a different version of Java, please use an alternate tag to run your Minecraft server container. The `stable` tag is similar to `latest`; however, it tracks [the most recent repository release/tag](https://github.com/itzg/docker-minecraft-server/releases/latest).
| Tag name | Java version | Linux | JVM Type | Architecture |
|------------------|--------------|--------|----------------|-------------------|
| latest | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| stable | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8 | 8 | Alpine | Hotspot | amd64 |
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
| java8-multiarch | 8 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
| java11 | 11 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java11-jdk | 11 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
| java17-graalvm | 17 | Oracle | Oracle GraalVM | amd64,arm64 |
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
| java21-alpine | 21 | Alpine | Hotspot | amd64 |
| java21 | 21 | Ubuntu | Hotspot | amd64,arm64 |
| java21-graalvm | 21 | Oracle | Oracle GraalVM | amd64,arm64 |
| Tag name | Java version | Linux | JVM Type | Architecture |
|------------------|--------------|--------|--------------------|-------------------|
| latest | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| stable | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8 | 8 | Alpine | Hotspot | amd64 |
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
| java8-multiarch | 8 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
| java11 | 11 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java11-jdk | 11 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
| java17-graalvm | 17 | Oracle | Oracle GraalVM[^1] | amd64,arm64 |
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
| java21-alpine | 21 | Alpine | Hotspot | amd64 |
| java21 | 21 | Ubuntu | Hotspot | amd64,arm64 |
| java21-graalvm | 21 | Oracle | Oracle GraalVM[^1] | amd64,arm64 |
For example, to use Java version 8 on any supported architecture:
@@ -47,6 +47,7 @@ For example, to use Java version 8 on any supported architecture:
### Deprecated Image Tags
The following image tags have been deprecated and are no longer receiving updates:
- java19
- adopt13
- adopt14
@@ -56,3 +57,5 @@ The following image tags have been deprecated and are no longer receiving update
- java16/java16-openj9
- java17-graalvm-ce
- java20-graalvm, java20, java20-alpine
[^1]: 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.

View File

@@ -0,0 +1,14 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
environment:
EULA: true
TYPE: FABRIC
MODRINTH_PROJECTS: |
jline4mcdsrv
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -10,7 +10,16 @@ services:
volumes:
- waterfall:/server
- ./waterfall-config:/config
# If you want to use Velocity here is a premade version that supports Velocity
# velocity-proxy:
# image: itzg/bungeecord
# environment:
# TYPE: VELOCITY
# ports:
# - "25565:25577"
# volumes:
# - velocity:/server
# - ./velocity-config:/config
mc:
image: itzg/minecraft-server
environment:
@@ -38,4 +47,4 @@ networks:
dbs:
# declared in ../dbs
external: true
name: dbs_default
name: dbs_default

View File

@@ -0,0 +1,155 @@
# Config version. Do not change this
config-version = "2.6"
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25565.
bind = "0.0.0.0:25565"
# What should be the MOTD? This gets displayed when the player adds your server to
# their server list. Only MiniMessage format is accepted.
motd = "<#09add3>A Velocity Server"
# What should we display for the maximum number of players? (Velocity does not support a cap
# on the number of players online.)
show-max-players = 500
# Should we authenticate players with Mojang? By default, this is on.
online-mode = true
# Should the proxy enforce the new public key security standard? By default, this is on.
force-key-authentication = true
# If client's ISP/AS sent from this proxy is different from the one from Mojang's
# authentication server, the player is kicked. This disallows some VPN and proxy
# connections but is a weak form of protection.
prevent-client-proxy-connections = false
# Should we forward IP addresses and other data to backend servers?
# Available options:
# - "none": No forwarding will be done. All players will appear to be connecting
# from the proxy and will have offline-mode UUIDs.
# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this
# if you run servers using Minecraft 1.12 or lower.
# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard
# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are
# unable to implement network level firewalling (on a shared host).
# - "modern": Forward player IPs and UUIDs as part of the login process using
# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher.
player-info-forwarding-mode = "NONE"
# If you are using modern or BungeeGuard IP forwarding, configure a file that contains a unique secret here.
# The file is expected to be UTF-8 encoded and not empty.
forwarding-secret-file = "forwarding.secret"
# Announce whether or not your server supports Forge. If you run a modded server, we
# suggest turning this on.
#
# If your network runs one modpack consistently, consider using ping-passthrough = "mods"
# instead for a nicer display in the server list.
announce-forge = false
# If enabled (default is false) and the proxy is in online mode, Velocity will kick
# any existing player who is online if a duplicate connection attempt is made.
kick-existing-players = false
# Should Velocity pass server list ping requests to a backend server?
# Available options:
# - "disabled": No pass-through will be done. The velocity.toml and server-icon.png
# will determine the initial server list ping response.
# - "mods": Passes only the mod list from your backend server into the response.
# The first server in your try list (or forced host) with a mod list will be
# used. If no backend servers can be contacted, Velocity won't display any
# mod information.
# - "description": Uses the description and mod list from the backend server. The first
# server in the try (or forced host) list that responds is used for the
# description and mod list.
# - "all": Uses the backend server's response as the proxy response. The Velocity
# configuration is used if no servers could be contacted.
ping-passthrough = "DISABLED"
# If not enabled (default is true) player IP addresses will be replaced by <ip address withheld> in logs
enable-player-address-logging = true
[servers]
# Configure your servers here. Each key represents the server's name, and the value
# represents the IP address of the server to connect to.
lobby = "127.0.0.1:30066"
factions = "127.0.0.1:30067"
minigames = "127.0.0.1:30068"
# In what order we should try servers when a player logs in or is kicked from a server.
try = [
"lobby"
]
[forced-hosts]
# Configure your forced hosts here.
"lobby.example.com" = [
"lobby"
]
"factions.example.com" = [
"factions"
]
"minigames.example.com" = [
"minigames"
]
[advanced]
# How large a Minecraft packet has to be before we compress it. Setting this to zero will
# compress all packets, and setting it to -1 will disable compression entirely.
compression-threshold = 256
# How much compression should be done (from 0-9). The default is -1, which uses the
# default level of 6.
compression-level = -1
# How fast (in milliseconds) are clients allowed to connect after the last connection? By
# default, this is three seconds. Disable this by setting this to 0.
login-ratelimit = 3000
# Specify a custom timeout for connection timeouts here. The default is five seconds.
connection-timeout = 5000
# Specify a read timeout for connections here. The default is 30 seconds.
read-timeout = 30000
# Enables compatibility with HAProxy's PROXY protocol. If you don't know what this is for, then
# don't enable it.
haproxy-protocol = false
# Enables TCP fast open support on the proxy. Requires the proxy to run on Linux.
tcp-fast-open = false
# Enables BungeeCord plugin messaging channel support on Velocity.
bungee-plugin-message-channel = true
# Shows ping requests to the proxy from clients.
show-ping-requests = false
# By default, Velocity will attempt to gracefully handle situations where the user unexpectedly
# loses connection to the server without an explicit disconnect message by attempting to fall the
# user back, except in the case of read timeouts. BungeeCord will disconnect the user instead. You
# can disable this setting to use the BungeeCord behavior.
failover-on-unexpected-server-disconnect = true
# Declares the proxy commands to 1.13+ clients.
announce-proxy-commands = true
# Enables the logging of commands
log-command-executions = false
# Enables logging of player connections when connecting to the proxy, switching servers
# and disconnecting from the proxy.
log-player-connections = true
[query]
# Whether to enable responding to GameSpy 4 query responses or not.
enabled = false
# If query is enabled, on what port should the query protocol listen on?
port = 25565
# This is the map name that is reported to the query services.
map = "Velocity"
# Whether plugins should be shown in query response by default or not
show-plugins = false

View File

@@ -0,0 +1,2 @@
proxies:
proxy-protocol: true

View File

@@ -0,0 +1,15 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
TYPE: PAPER
ports:
# Use host port 25566 assuming mc-router or similar is bound to 25565
- "25566:25565"
volumes:
- mc-data:/data
- ./config:/config:ro
volumes:
mc-data: {}

View File

@@ -24,7 +24,9 @@ java_clients_connections() {
local connections
if java_running ; then
if ! connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count); then
connections=0
# consider it a non-zero player count if the ping fails
# otherwise a laggy server with players connected could get paused
connections=1
fi
else
connections=0

View File

@@ -33,10 +33,11 @@ markdown_extensions:
permalink: true
- attr_list
- def_list
- footnotes
- tables
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
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
@@ -49,7 +50,7 @@ markdown_extensions:
user: camalot
repo: mkdocs-test
- mkdocs-click
copyright: Copyright &copy; itzg 2023.
copyright: Copyright &copy; itzg 2024.
plugins:
- search
- autorefs

View File

@@ -10,6 +10,7 @@ set -eu
: "${CF_FILENAME_MATCHER:=}"
: "${CF_PARALLEL_DOWNLOADS:=4}"
: "${CF_FORCE_SYNCHRONIZE:=false}"
: "${CF_FORCE_REINSTALL_MODLOADER:=false}"
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
: "${CF_EXCLUDE_MODS:=}"
: "${CF_FORCE_INCLUDE_MODS:=}"
@@ -49,6 +50,7 @@ if [[ ${CF_OVERRIDES_EXCLUSIONS} ]]; then
fi
args+=(
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
--force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
)

View File

@@ -231,8 +231,10 @@ fi
mcServerRunnerArgs=(
--stop-duration "${STOP_DURATION:-60}s"
--named-pipe "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
)
if isTrue "${CREATE_CONSOLE_IN_PIPE:-false}"; then
mcServerRunnerArgs+=(--named-pipe "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}")
fi
if [[ ${STOP_SERVER_ANNOUNCE_DELAY} ]]; then
mcServerRunnerArgs+=(--stop-server-announce-delay "${STOP_SERVER_ANNOUNCE_DELAY}s")
fi

View File

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

View File

@@ -3,41 +3,33 @@
# go to script root directory
cd "$(dirname "$0")" || exit 1
# compose down function for reuse
down() {
docker-compose down -v --remove-orphans
}
checkandExitOnFailure(){
failed=$1
# docker-compose logs outputs messages from the specified container
if $failed; then
docker-compose logs mc
down
cd ..
exit 2
fi
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(){
folder=$1
cd "$folder"
file="$1"
failed=false
# run the monitor to validate the Minecraft image is healthy
docker-compose run monitor || failed=true
echo "${folder} Result: failed=$failed"
checkandExitOnFailure $failed
down
cd ..
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
else
down "$file"
fi
}
# go through each folder in fulltests and run fullbuilds
FOLDERS=$(ls)
for folder in $FOLDERS; do
# If folder is a directory
if [ -d "$folder" ]; then
echo "Starting Tests on ${folder}"
fullMinecraftUpTest $folder
files=$(ls */docker-compose.yml)
for file in $files; do
echo "Starting Tests on $(dirname "$file")"
if ! fullMinecraftUpTest "$file"; then
exit 2
fi
done

View File

@@ -4,7 +4,8 @@ services:
monitor:
depends_on:
- mc
image: itzg/mc-monitor:${MC_MONITOR_VERSION:-0.10.4}
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
entrypoint: mc-monitor
command: status --host mc --retry-interval 1s --timeout 1s --retry-limit 300
mc:
restart: "no"