mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-03-31 10:52:45 +00:00
Compare commits
27 Commits
fix/modrit
...
test/2421
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3ccdcac9e | ||
|
|
6fce520004 | ||
|
|
ec539a5dd2 | ||
|
|
7427bc9043 | ||
|
|
8ab104f6b7 | ||
|
|
f15cbb4ca1 | ||
|
|
fa235e97c5 | ||
|
|
d5e315bba8 | ||
|
|
91ad2974ec | ||
|
|
59902566f3 | ||
|
|
411391baa1 | ||
|
|
cadc48b41a | ||
|
|
1396a1ef6c | ||
|
|
0cf5195fc5 | ||
|
|
17e2f90b91 | ||
|
|
a079dd0ff0 | ||
|
|
c4d8972a83 | ||
|
|
b494124a2d | ||
|
|
d8ad2e5721 | ||
|
|
ec7bd14451 | ||
|
|
2097702daa | ||
|
|
dc149eaa01 | ||
|
|
f14b77db05 | ||
|
|
df53fe3971 | ||
|
|
bb57d7e99f | ||
|
|
03034d2f15 | ||
|
|
8fd1495795 |
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -1,7 +1,23 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
# Maintain dependencies for GitHub Actions
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
groups:
|
||||||
|
updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
- minor
|
||||||
|
- package-ecosystem: pip
|
||||||
|
directory: "/docs"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
groups:
|
||||||
|
patches:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
|||||||
30
.github/workflows/build-multiarch.yml
vendored
30
.github/workflows/build-multiarch.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Test and Build multi-architecture
|
name: Build and Publish
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -18,10 +18,11 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
|
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
|
||||||
variant:
|
variant:
|
||||||
|
- java21-graalvm
|
||||||
- java20
|
- java20
|
||||||
- java20-alpine
|
- java20-alpine
|
||||||
- java17
|
- java17
|
||||||
- java17-graalvm-ce
|
- java17-graalvm
|
||||||
- java17-jdk
|
- java17-jdk
|
||||||
- java17-openj9
|
- java17-openj9
|
||||||
- java17-alpine
|
- java17-alpine
|
||||||
@@ -34,6 +35,11 @@ jobs:
|
|||||||
- java11-openj9
|
- java11-openj9
|
||||||
- java11-jdk
|
- java11-jdk
|
||||||
include:
|
include:
|
||||||
|
# JAVA 21:
|
||||||
|
- variant: java21-graalvm
|
||||||
|
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol8
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
mcVersion: 1.20.2
|
||||||
# JAVA 20:
|
# JAVA 20:
|
||||||
- variant: java20
|
- variant: java20
|
||||||
baseImage: eclipse-temurin:20-jre
|
baseImage: eclipse-temurin:20-jre
|
||||||
@@ -49,8 +55,8 @@ jobs:
|
|||||||
baseImage: eclipse-temurin:17-jre-focal
|
baseImage: eclipse-temurin:17-jre-focal
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
mcVersion: 1.18.2
|
mcVersion: 1.18.2
|
||||||
- variant: java17-graalvm-ce
|
- variant: java17-graalvm
|
||||||
baseImage: ghcr.io/graalvm/graalvm-ce:ol8-java17
|
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol8
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
mcVersion: 1.18.2
|
mcVersion: 1.18.2
|
||||||
- variant: java17-jdk
|
- variant: java17-jdk
|
||||||
@@ -106,14 +112,14 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4.1.0
|
||||||
with:
|
with:
|
||||||
# for build-files step
|
# for build-files step
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5.0.0
|
||||||
with:
|
with:
|
||||||
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
|
# 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.
|
# then the use of ${{ github.repository_owner }} will need to be replaced.
|
||||||
@@ -139,13 +145,13 @@ 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@v2
|
uses: docker/setup-buildx-action@v3.0.0
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.2.0
|
uses: docker/setup-qemu-action@v3.0.0
|
||||||
|
|
||||||
- name: Build for test
|
- name: Build for test
|
||||||
uses: docker/build-push-action@v4.1.1
|
uses: docker/build-push-action@v5.0.0
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: ${{ env.IMAGE_TO_TEST }}
|
tags: ${{ env.IMAGE_TO_TEST }}
|
||||||
@@ -168,14 +174,14 @@ jobs:
|
|||||||
tests/test.sh
|
tests/test.sh
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3.0.0
|
||||||
if: env.HAS_IMAGE_REPO_ACCESS
|
if: env.HAS_IMAGE_REPO_ACCESS
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GHCR
|
- name: Login to GHCR
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3.0.0
|
||||||
if: env.HAS_IMAGE_REPO_ACCESS
|
if: env.HAS_IMAGE_REPO_ACCESS
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -183,7 +189,7 @@ jobs:
|
|||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4.1.1
|
uses: docker/build-push-action@v5.0.0
|
||||||
if: github.actor == github.repository_owner
|
if: github.actor == github.repository_owner
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
|
|||||||
8
.github/workflows/verify-pr.yml
vendored
8
.github/workflows/verify-pr.yml
vendored
@@ -45,16 +45,16 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4.1.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@v2
|
uses: docker/setup-buildx-action@v3.0.0
|
||||||
|
|
||||||
- name: Confirm multi-arch build
|
- name: Confirm multi-arch build
|
||||||
uses: docker/build-push-action@v4.1.1
|
uses: docker/build-push-action@v5.0.0
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
@@ -64,7 +64,7 @@ jobs:
|
|||||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||||
|
|
||||||
- name: Build for test
|
- name: Build for test
|
||||||
uses: docker/build-push-action@v4.1.1
|
uses: docker/build-push-action@v5.0.0
|
||||||
with:
|
with:
|
||||||
# Only build single platform since loading multi-arch image into daemon fails with
|
# Only build single platform since loading multi-arch image into daemon fails with
|
||||||
# "docker exporter does not currently support exporting manifest lists"
|
# "docker exporter does not currently support exporting manifest lists"
|
||||||
|
|||||||
15
Dockerfile
15
Dockerfile
@@ -9,14 +9,11 @@ ARG TARGETOS
|
|||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
# CI system should set this to a hash or git revision of the build directory and it's contents to
|
|
||||||
# ensure consistent cache updates.
|
|
||||||
ARG BUILD_FILES_REV=1
|
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
REV=${BUILD_FILES_REV} TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
/build/run.sh setup-user
|
||||||
|
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
REV=${BUILD_FILES_REV} /build/run.sh setup-user
|
TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
||||||
|
|
||||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -35,14 +32,14 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=0.12.2 --var app=mc-monitor --file {{.app}} \
|
--var version=0.12.3 --var app=mc-monitor --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.34.5
|
ARG MC_HELPER_VERSION=1.36.1
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
ARG MC_HELPER_BASE_URL=https://github.com/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
|
||||||
@@ -61,9 +58,7 @@ ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000
|
|||||||
COPY --chmod=755 scripts/start* /
|
COPY --chmod=755 scripts/start* /
|
||||||
COPY --chmod=755 bin/ /usr/local/bin/
|
COPY --chmod=755 bin/ /usr/local/bin/
|
||||||
COPY --chmod=755 bin/mc-health /health.sh
|
COPY --chmod=755 bin/mc-health /health.sh
|
||||||
COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
|
COPY --chmod=644 files/* /image/
|
||||||
# By default this file gets retrieved from repo, but bundle in image as potential fallback
|
|
||||||
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
|
|
||||||
COPY --chmod=755 files/auto /auto
|
COPY --chmod=755 files/auto /auto
|
||||||
|
|
||||||
RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar
|
RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -2,7 +2,7 @@
|
|||||||
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
[](https://hub.docker.com/r/itzg/minecraft-server/)
|
||||||
[](https://github.com/itzg/docker-minecraft-server/issues)
|
[](https://github.com/itzg/docker-minecraft-server/issues)
|
||||||
[](https://discord.gg/DXfKpjB)
|
[](https://discord.gg/DXfKpjB)
|
||||||
[](https://github.com/itzg/docker-minecraft-server/actions)
|
[](https://github.com/itzg/docker-minecraft-server/actions/workflows/build-multiarch.yml)
|
||||||
[](https://www.buymeacoffee.com/itzg)
|
[](https://www.buymeacoffee.com/itzg)
|
||||||
[](https://docker-minecraft-server.readthedocs.io/en/latest/?badge=latest)
|
[](https://docker-minecraft-server.readthedocs.io/en/latest/?badge=latest)
|
||||||
|
|
||||||
@@ -585,7 +585,7 @@ Configuration options with defaults:
|
|||||||
|
|
||||||
NAME}"
|
NAME}"
|
||||||
|
|
||||||
> NOTE: instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
|
> NOTE: instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.wiki/w/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
|
||||||
|
|
||||||
### Running a Crucible server
|
### Running a Crucible server
|
||||||
|
|
||||||
@@ -1090,7 +1090,7 @@ If you leave it off, a default is computed from the server type and version, suc
|
|||||||
|
|
||||||
That way you can easily differentiate between several servers you may have started.
|
That way you can easily differentiate between several servers you may have started.
|
||||||
|
|
||||||
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes) to be used consistently with all server versions. For example,
|
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.wiki/w/Formatting_codes) to be used consistently with all server versions. For example,
|
||||||
|
|
||||||
-e MOTD="A §l§cMinecraft§r §nserver"
|
-e MOTD="A §l§cMinecraft§r §nserver"
|
||||||
|
|
||||||
@@ -1122,7 +1122,7 @@ To whitelist players for your Minecraft server, you can:
|
|||||||
- Provide the url or path to a whitelist file via `WHITELIST_FILE` environment variable
|
- Provide the url or path to a whitelist file via `WHITELIST_FILE` environment variable
|
||||||
`docker run -d -e WHITELIST_FILE=/extra/whitelist.json ...`
|
`docker run -d -e WHITELIST_FILE=/extra/whitelist.json ...`
|
||||||
|
|
||||||
When either is set, [whitelisting of connecting users](https://minecraft.fandom.com/wiki/Server.properties#white-list) is enabled . If managing the list manually, `ENABLE_WHITELIST` can be set to "true" to set the `white-list` property.
|
When either is set, [whitelisting of connecting users](https://minecraft.wiki/w/Server.properties#white-list) is enabled . If managing the list manually, `ENABLE_WHITELIST` can be set to "true" to set the `white-list` property.
|
||||||
|
|
||||||
If whitelist configuration already exists, `WHITELIST_FILE` will not be retrieved and any usernames in `WHITELIST` are **added** to the whitelist configuration. You can enforce regeneration of the whitelist on each server startup by setting `OVERRIDE_WHITELIST` to "true". This will delete the whitelist file before processing whitelist configuration.
|
If whitelist configuration already exists, `WHITELIST_FILE` will not be retrieved and any usernames in `WHITELIST` are **added** to the whitelist configuration. You can enforce regeneration of the whitelist on each server startup by setting `OVERRIDE_WHITELIST` to "true". This will delete the whitelist file before processing whitelist configuration.
|
||||||
|
|
||||||
@@ -1132,7 +1132,7 @@ If whitelist configuration already exists, `WHITELIST_FILE` will not be retrieve
|
|||||||
|
|
||||||
> If running Minecraft 1.7.5 or earlier, these variables will apply to `white-list.txt`, with 1.7.6 implementing support for `whitelist.json`. Make sure your `WHITELIST_FILE` is in the appropriate format.
|
> If running Minecraft 1.7.5 or earlier, these variables will apply to `white-list.txt`, with 1.7.6 implementing support for `whitelist.json`. Make sure your `WHITELIST_FILE` is in the appropriate format.
|
||||||
|
|
||||||
To [enforce the whitelist changes immediately](https://minecraft.fandom.com/wiki/Server.properties#enforce-whitelist) when whitelist commands are used , set `ENFORCE_WHITELIST` to "true".
|
To [enforce the whitelist changes immediately](https://minecraft.wiki/w/Server.properties#enforce-whitelist) when whitelist commands are used , set `ENFORCE_WHITELIST` to "true".
|
||||||
|
|
||||||
### Op/Administrator Players
|
### Op/Administrator Players
|
||||||
|
|
||||||
@@ -1303,7 +1303,7 @@ If using a negative value for the seed, make sure to quote the value such as:
|
|||||||
|
|
||||||
By default, Minecraft servers are configured to run in Survival mode. You can
|
By default, Minecraft servers are configured to run in Survival mode. You can
|
||||||
change the mode using `MODE` where you can either provide the [standard
|
change the mode using `MODE` where you can either provide the [standard
|
||||||
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
|
numerical values](http://minecraft.wiki/Game_mode#Game_modes) or the
|
||||||
shortcut values:
|
shortcut values:
|
||||||
|
|
||||||
- creative
|
- creative
|
||||||
@@ -1325,9 +1325,9 @@ environment variable set to `false`, such as
|
|||||||
### Level Type and Generator Settings
|
### Level Type and Generator Settings
|
||||||
|
|
||||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||||
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.fandom.com/wiki/Server.properties#level-type).
|
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.wiki/w/Server.properties#level-type).
|
||||||
|
|
||||||
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.fandom.com/wiki/Server.properties#generator-settings).
|
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.wiki/w/Server.properties#generator-settings).
|
||||||
|
|
||||||
### Custom Server Resource Pack
|
### Custom Server Resource Pack
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,12 @@ apk add --no-cache -U \
|
|||||||
zstd \
|
zstd \
|
||||||
nfs-utils \
|
nfs-utils \
|
||||||
libpcap \
|
libpcap \
|
||||||
libwebp
|
libwebp \
|
||||||
|
libcap
|
||||||
|
|
||||||
# Patched knockd
|
# 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
|
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
|
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
|
||||||
|
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
||||||
|
chown minecraft /usr/local/sbin/knockd
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ $(uname -m) == "aarch64" ]]; then
|
if [[ $(uname -m) == "aarch64" ]]; then
|
||||||
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-arm64
|
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64
|
||||||
chmod +x /bin/gosu
|
chmod +x /bin/gosu
|
||||||
elif [[ $(uname -m) == "x86_64" ]]; then
|
elif [[ $(uname -m) == "x86_64" ]]; then
|
||||||
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-amd64
|
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64
|
||||||
chmod +x /bin/gosu
|
chmod +x /bin/gosu
|
||||||
else
|
else
|
||||||
echo "Not supported!"
|
echo "Not supported!"
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ dnf install -y ImageMagick \
|
|||||||
zstd \
|
zstd \
|
||||||
lbzip2 \
|
lbzip2 \
|
||||||
libpcap \
|
libpcap \
|
||||||
libwebp
|
libwebp \
|
||||||
|
findutils \
|
||||||
|
which
|
||||||
|
|
||||||
bash /build/ol/install-gosu.sh
|
bash /build/ol/install-gosu.sh
|
||||||
|
|
||||||
@@ -44,3 +46,5 @@ 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
|
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
|
||||||
|
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
||||||
|
chown minecraft /usr/local/sbin/knockd
|
||||||
|
|||||||
@@ -35,4 +35,6 @@ 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
|
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
|
||||||
|
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
||||||
|
chown minecraft /usr/local/sbin/knockd
|
||||||
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
|
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ If you leave it off, a default is computed from the server type and version, suc
|
|||||||
|
|
||||||
That way you can easily differentiate between several servers you may have started.
|
That way you can easily differentiate between several servers you may have started.
|
||||||
|
|
||||||
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes) to be used consistently with all server versions. For example,
|
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.wiki/w/Formatting_codes) to be used consistently with all server versions. For example,
|
||||||
|
|
||||||
-e MOTD="A §l§cMinecraft§r §nserver"
|
-e MOTD="A §l§cMinecraft§r §nserver"
|
||||||
|
|
||||||
@@ -62,24 +62,34 @@ To whitelist players for your Minecraft server, you can:
|
|||||||
user3
|
user3
|
||||||
```
|
```
|
||||||
|
|
||||||
When either is set, [whitelisting of connecting users](https://minecraft.fandom.com/wiki/Server.properties#white-list) is enabled.
|
When either is set, [whitelisting of connecting users](https://minecraft.wiki/w/Server.properties#white-list) is enabled.
|
||||||
|
|
||||||
Use of `WHITELIST_FILE` will **overwrite** an existing `whitelist.json` file; however, the option can be combined with `WHITELIST` to refine the list.
|
To change the behavior when the whitelist file already exists, set the variable `EXISTING_WHITELIST_FILE` to one of the following options:
|
||||||
|
|
||||||
By default, `WHITELIST` will keep the `whitelist.json` fully synchronized with the given list. All whitelist entries can be removed by setting `WHITELIST` to an empty string. To only append new users, set `APPEND_WHITELIST` to "true".
|
`SKIP` (default)
|
||||||
|
: Skip processing of the whitelist file when one is already present. This is the same as setting the legacy variable `OVERRIDE_WHITELIST` to "false".
|
||||||
|
|
||||||
|
`SYNCHRONIZE`
|
||||||
|
: Synchronize the list of users in the file with the `WHITELIST` or `WHITELIST_FILE` provided. When using both, `WHITELIST` will take precedence. This is the same as setting the legacy variable `OVERRIDE_WHITELIST` to "true".
|
||||||
|
|
||||||
|
`MERGE`
|
||||||
|
: Merge the list of users from `WHITELIST` into the existing file. `WHITELIST_FILE` cannot be used with this option.
|
||||||
|
|
||||||
|
`SYNC_FILE_MERGE_LIST`
|
||||||
|
: When `WHITELIST_FILE` is provided it will overwrite an existing whitelist file. Also, if `WHITELIST` is provided, then those users will be merged into the newly copied file.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
For versions prior to 1.7.3, `white-list.txt` will be maintained instead. Only usernames are supported for those versions.
|
For versions prior to 1.7.3, `white-list.txt` will be maintained instead. Only usernames are supported for those versions.
|
||||||
|
|
||||||
To [enforce the whitelist changes immediately](https://minecraft.fandom.com/wiki/Server.properties#enforce-whitelist) when whitelist commands are used , set `ENFORCE_WHITELIST` to "true". If managing the whitelist file manually, `ENABLE_WHITELIST` can be set to "true" to set the `white-list` property.
|
To [enforce the whitelist changes immediately](https://minecraft.wiki/w/Server.properties#enforce-whitelist) when whitelist commands are used , set `ENFORCE_WHITELIST` to "true". If managing the whitelist file manually, `ENABLE_WHITELIST` can be set to "true" to set the `white-list` property.
|
||||||
|
|
||||||
### Op/Administrator Players
|
### Op/Administrator Players
|
||||||
|
|
||||||
Similar to the whitelist, to add users as operators (aka administrators) to your Minecraft server, you can:
|
Similar to the whitelist, users can be provisioned as operators (aka administrators) to your Minecraft server by
|
||||||
|
|
||||||
- Provide a list of usernames and/or UUIDs separated by commas or newlines via the `OPS` environment variable
|
- Providing a list of usernames and/or UUIDs separated by commas or newlines via the `OPS` environment variable
|
||||||
- Provide the URL or container path to an ops file via `OPS_FILE` that will be retrieved/copied into the standard location
|
- Providing the URL or container path to an ops file via `OPS_FILE` that will be retrieved/copied into the standard location
|
||||||
|
|
||||||
!!! example
|
!!! example
|
||||||
|
|
||||||
@@ -92,9 +102,19 @@ Similar to the whitelist, to add users as operators (aka administrators) to your
|
|||||||
user3
|
user3
|
||||||
```
|
```
|
||||||
|
|
||||||
Use of `OPS_FILE` will **overwrite** an existing `ops.json` file; however, the option can be combined with `OPS` to refine the list.
|
To change the behavior when the ops file already exists, set the variable `EXISTING_OPS_FILE` to one of the following options:
|
||||||
|
|
||||||
By default, `OPS` will keep the `ops.json` fully synchronized with the given list. All ops entries can be removed by setting `OPS` to an empty string. To only append new users, set `APPEND_OPS` to "true". New entries will be assigned [level 4](https://glimpse.me/blog/how-to-op-yourself-in-minecraft/) and not bypass player limit. Manual changes to those fields will be retained.
|
`SKIP` (default)
|
||||||
|
: Skip processing of the ops file when one is already present. This is the same as setting the legacy variable `OVERRIDE_OPS` to "false".
|
||||||
|
|
||||||
|
`SYNCHRONIZE`
|
||||||
|
: Synchronize the list of users in the file with the `OPS` or `OPS_FILE` provided. When using both, `OPS` will take precedence. The `level` and `bypassesPlayerLimit` will be retained from previous entries. This is the same as setting the legacy variable `OVERRIDE_OPS` to "true".
|
||||||
|
|
||||||
|
`MERGE`
|
||||||
|
: Merge the list of users from `OPS` into the existing file. `OPS_FILE` cannot be used with this option.
|
||||||
|
|
||||||
|
`SYNC_FILE_MERGE_LIST`
|
||||||
|
: When `OPS_FILE` is provided it will overwrite an existing ops file. Also, if `OPS` is provided, then those users will be merged into the newly copied file.
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
@@ -259,7 +279,7 @@ If using a negative value for the seed, make sure to quote the value such as:
|
|||||||
|
|
||||||
By default, Minecraft servers are configured to run in Survival mode. You can
|
By default, Minecraft servers are configured to run in Survival mode. You can
|
||||||
change the mode using `MODE` where you can either provide the [standard
|
change the mode using `MODE` where you can either provide the [standard
|
||||||
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
|
numerical values](http://minecraft.wiki/Game_mode#Game_modes) or the
|
||||||
shortcut values:
|
shortcut values:
|
||||||
|
|
||||||
- creative
|
- creative
|
||||||
@@ -281,9 +301,9 @@ environment variable set to `false`, such as
|
|||||||
### Level Type and Generator Settings
|
### Level Type and Generator Settings
|
||||||
|
|
||||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||||
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.fandom.com/wiki/Server.properties#level-type).
|
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.wiki/w/Server.properties#level-type).
|
||||||
|
|
||||||
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.fandom.com/wiki/Server.properties#generator-settings).
|
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.wiki/w/Server.properties#generator-settings).
|
||||||
|
|
||||||
### Custom Server Resource Pack
|
### Custom Server Resource Pack
|
||||||
|
|
||||||
@@ -333,10 +353,28 @@ If you must, the server port can be set like:
|
|||||||
|
|
||||||
**however**, be sure to change your port mapping accordingly and be prepared for some features to break.
|
**however**, be sure to change your port mapping accordingly and be prepared for some features to break.
|
||||||
|
|
||||||
|
### Custom server properties
|
||||||
|
|
||||||
|
Some mods/plugins utilize custom `server.properties` entries which can be declared via the `CUSTOM_SERVER_PROPERTIES` environment variable. The contents must be newline delimited `name=value` pairs.
|
||||||
|
|
||||||
|
Within a compose file, newline delimited entries can be declared as shown here:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
CUSTOM_SERVER_PROPERTIES: |
|
||||||
|
custom1=value1
|
||||||
|
defaultworldgenerator-port=f8c04631-f744-11ec-b260-f02f74b094e0
|
||||||
|
```
|
||||||
|
|
||||||
|
When using `docker run` from a bash shell, the entries must be quoted with the `$'` syntax, such as
|
||||||
|
|
||||||
|
```
|
||||||
|
-e CUSTOM_SERVER_PROPERTIES=$'k1=v1\nk2=v2'
|
||||||
|
```
|
||||||
|
|
||||||
### Other server property mappings
|
### Other server property mappings
|
||||||
|
|
||||||
| Environment Variable | Server Property |
|
| Environment Variable | Server Property |
|
||||||
| --------------------------------- | --------------------------------- |
|
|-----------------------------------|-----------------------------------|
|
||||||
| BROADCAST_CONSOLE_TO_OPS | broadcast-console-to-ops |
|
| BROADCAST_CONSOLE_TO_OPS | broadcast-console-to-ops |
|
||||||
| BROADCAST_RCON_TO_OPS | broadcast-rcon-to-ops |
|
| BROADCAST_RCON_TO_OPS | broadcast-rcon-to-ops |
|
||||||
| ENABLE_STATUS | enable-status |
|
| ENABLE_STATUS | enable-status |
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ The following environment variables define the behaviour of auto-pausing:
|
|||||||
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
|
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
|
||||||
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
|
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
|
||||||
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
|
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
|
||||||
|
- `AUTOPAUSE_SUDO`, default "true"
|
||||||
|
specifies if the knockd service should be run via sudo in order to elevate its privileges
|
||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ cd build/distributions
|
|||||||
jwebserver -b 0.0.0.0 -p 8008
|
jwebserver -b 0.0.0.0 -p 8008
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If `jwebserver` is not available, try `java -m jdk.httpserver`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
|
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
|
||||||
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
|
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
|
||||||
|
|||||||
28
docs/misc/examples.md
Normal file
28
docs/misc/examples.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Examples
|
||||||
|
|
||||||
|
Various examples are [maintained in the repository](https://github.com/itzg/docker-minecraft-server/tree/master/examples). The sections below highlight a few particular ones.
|
||||||
|
|
||||||
|
## Bedrock compatible server
|
||||||
|
|
||||||
|
Using the [GeyserMC plugin](https://geysermc.org/) with a Paper server (or similar) "enables clients from Minecraft Bedrock Edition to join your Minecraft Java server". The example also includes [Floodgate](https://wiki.geysermc.org/floodgate/) which "allows Xbox Live authenticated Bedrock users to join without a Java Edition account".
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
TYPE: "PAPER"
|
||||||
|
PLUGINS: |
|
||||||
|
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
|
||||||
|
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
- "19132:19132/udp"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
```
|
||||||
|
|
||||||
|
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)
|
||||||
@@ -25,3 +25,8 @@ healthcheck:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
||||||
|
|
||||||
|
### Healthchecks for older versions
|
||||||
|
|
||||||
|
This container disables Healthchecks for Versions before b1.8 as those versions do not support any kind of server pinging.
|
||||||
|
For more information see [Server List Ping](https://wiki.vg/Server_List_Ping#Beta_1.8_to_1.3)
|
||||||
|
|||||||
@@ -47,16 +47,14 @@ These paths work well if you want to have a common set of modules in a separate
|
|||||||
|
|
||||||
## Zip file modpack
|
## Zip file modpack
|
||||||
|
|
||||||
Like the `WORLD` option above, you can specify the URL or path of a "mod pack"
|
Like the `WORLD` option above, you can specify the URL or container path of a "mod pack" to download and install into `mods` for Forge/Fabric or `plugins` for Bukkit/Spigot. To use this option pass the environment variable `MODPACK`, such as
|
||||||
to download and install into `mods` for Forge/Fabric or `plugins` for Bukkit/Spigot.
|
|
||||||
To use this option pass the environment variable `MODPACK`, such as
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
The referenced URL must be a zip file with one or more jar files at the
|
The referenced URL/file must be a zip file with one or more jar files at the
|
||||||
top level of the zip archive. Make sure the jars are compatible with the
|
top level of the zip archive. Make sure the jars are compatible with the
|
||||||
particular `TYPE` of server you are running.
|
particular `TYPE` of server you are running.
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
## Extra options
|
## Extra options
|
||||||
|
|
||||||
`MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES`
|
`MODRINTH_DOWNLOAD_DEPENDENCIES`
|
||||||
: Required dependencies of the project will _always_ be downloaded and optional dependencies can also be downloaded by setting this to `true`. The default is "true"
|
: Can be set to `none` (the default), `required`, or `optional` to download required and/or optional dependencies.
|
||||||
|
|
||||||
`MODRINTH_ALLOWED_VERSION_TYPE`
|
`MODRINTH_ALLOWED_VERSION_TYPE`
|
||||||
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`.
|
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`.
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
mkdocs
|
mkdocs == 1.5.3
|
||||||
mkdocs-material-extensions
|
mkdocs-material-extensions == 1.2
|
||||||
mkdocs-material
|
mkdocs-material == 9.4.3
|
||||||
mkdocs-autorefs
|
mkdocs-autorefs == 0.5.0
|
||||||
mkdocstrings
|
mkdocstrings == 0.23.0
|
||||||
mkdocs-literate-nav
|
mkdocs-literate-nav == 0.6.1
|
||||||
mdx-gh-links
|
mdx-gh-links == 0.3.1
|
||||||
mkdocs-click
|
mkdocs-click == 0.8.1
|
||||||
mkdocs-static-i18n
|
mkdocs-static-i18n == 1.0.6
|
||||||
@@ -1,12 +1,20 @@
|
|||||||
# Bukkit/Spigot
|
# Bukkit/Spigot
|
||||||
|
|
||||||
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
|
Run a Bukkit/Spigot server type by setting the environment variable `TYPE` to "BUKKIT" or "SPIGOT".
|
||||||
|
|
||||||
```
|
!!! example
|
||||||
docker run -d -v /path/on/host:/data \
|
|
||||||
-e TYPE=SPIGOT \
|
Command-line
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
```
|
||||||
```
|
docker run ... -e TYPE=SPIGOT ...
|
||||||
|
```
|
||||||
|
|
||||||
|
Compose
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
...
|
||||||
|
TYPE: SPIGOT
|
||||||
|
```
|
||||||
|
|
||||||
If the downloaded server jar is corrupted, set `FORCE_REDOWNLOAD` to "true" to force a re-download during next container startup. After successfully re-downloading, you should remove that or set to "false".
|
If the downloaded server jar is corrupted, set `FORCE_REDOWNLOAD` to "true" to force a re-download during next container startup. After successfully re-downloading, you should remove that or set to "false".
|
||||||
|
|
||||||
@@ -15,16 +23,14 @@ If you are hosting your own copy of Bukkit/Spigot you can override the download
|
|||||||
- -e BUKKIT_DOWNLOAD_URL=<url>
|
- -e BUKKIT_DOWNLOAD_URL=<url>
|
||||||
- -e SPIGOT_DOWNLOAD_URL=<url>
|
- -e SPIGOT_DOWNLOAD_URL=<url>
|
||||||
|
|
||||||
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
|
|
||||||
|
|
||||||
Plugins can either be managed within the `plugins` subdirectory of the [data directory](../../data-directory.md) or you can also [attach a `/plugins` volume](../../mods-and-plugins/index.md#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
|
|
||||||
|
|
||||||
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
|
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
Some of the `VERSION` values are not as intuitive as you would think, so make sure to click into the version entry to find the **exact** version needed for the download. For example, "1.8" is not sufficient since their download naming expects `1.8-R0.1-SNAPSHOT-latest` exactly.
|
Some of the `VERSION` values are not as intuitive as you would think, so make sure to click into the version entry to find the **exact** version needed for the download. For example, "1.8" is not sufficient since their download naming expects `1.8-R0.1-SNAPSHOT-latest` exactly.
|
||||||
|
|
||||||
|
## Build from source
|
||||||
|
|
||||||
|
You can build spigot from source by setting the environment variable `BUILD_FROM_SOURCE` to "true".
|
||||||
|
|
||||||
## Alternatives
|
## Alternatives
|
||||||
|
|
||||||
### Canyon
|
### Canyon
|
||||||
|
|||||||
@@ -35,3 +35,23 @@ In both of the cases above, there is no need for the `VERSION` or `FORGE_VERSION
|
|||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
||||||
|
|
||||||
|
## Alternatives
|
||||||
|
|
||||||
|
### NeoForge
|
||||||
|
|
||||||
|
Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge server can be automatically managed by setting `TYPE` to "NEOFORGE". `VERSION` specifies the Minecraft version and `NEOFORGE_VERSION` can be set to select a specific sub-version. By default, the latest NeoForge version available for the requested Minecraft version will be used.
|
||||||
|
|
||||||
|
!!! example
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -e TYPE=NEOFORGE -e VERSION=1.20.1 -e NEOFORGE_VERSION=47.1.79 ...
|
||||||
|
```
|
||||||
|
|
||||||
|
or in a compose file
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
TYPE: NEOFORGE
|
||||||
|
VERSION: "1.20.1"
|
||||||
|
NEOFORGE_VERSION: "47.1.79"
|
||||||
|
```
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Configuration options with defaults:
|
|||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
Instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
|
Instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.wiki/w/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
|
||||||
|
|
||||||
## Crucible
|
## Crucible
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
|
|
||||||
/etc/timezone:/etc/timezone:ro</code>
|
/etc/timezone:/etc/timezone:ro</code>
|
||||||
</td>
|
</td>
|
||||||
<td><code>1G</code></td>
|
<td><code>UTC</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -260,7 +260,7 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
</tr>
|
</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.gamepedia.com/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 />
|
||||||
<ul>
|
<ul>
|
||||||
<li>creative</li>
|
<li>creative</li>
|
||||||
<li>survival</li>
|
<li>survival</li>
|
||||||
@@ -278,14 +278,14 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>LEVEL_TYPE</code></td>
|
<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.fandom.com/wiki/Server.properties#level-type">an expected type listed here</a>.
|
<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>
|
||||||
<td><code>minecraft:default</code></td>
|
<td><code>minecraft:default</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>GENERATOR_SETTINGS</code></td>
|
<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.fandom.com/wiki/Server.properties#generator-settings">as described here</a>.</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><code></code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -13,25 +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).
|
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 |
|
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||||
|-------------------|--------------|--------|-------------|-------------------|
|
|------------------|--------------|--------|----------------|-------------------|
|
||||||
| latest | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| latest | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
| stable | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| stable | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
| java8 | 8 | Alpine | Hotspot | amd64 |
|
| java8 | 8 | Alpine | Hotspot | amd64 |
|
||||||
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
|
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
|
||||||
| java8-multiarch | 8 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| java8-multiarch | 8 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
||||||
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
|
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
|
||||||
| java11 | 11 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| java11 | 11 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
| java11-jdk | 11 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
|
| java11-jdk | 11 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
|
||||||
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
||||||
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
|
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
|
||||||
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
|
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
|
||||||
| java17-graalvm-ce | 17 | Oracle | GraalVM CE | amd64,arm64 |
|
| java17-graalvm | 17 | Oracle | Oracle GraalVM | amd64,arm64 |
|
||||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
|
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
|
||||||
| java20-alpine | 20 | Alpine | Hotspot | amd64 |
|
| java20-alpine | 20 | Alpine | Hotspot | amd64 |
|
||||||
| java20 | 20 | Ubuntu | Hotspot | amd64,arm64 |
|
| java20 | 20 | Ubuntu | Hotspot | amd64,arm64 |
|
||||||
|
| java21-graalvm | 21 | Oracle | Oracle GraalVM | amd64,arm64 |
|
||||||
|
|
||||||
For example, to use Java version 8 on any supported architecture:
|
For example, to use Java version 8 on any supported architecture:
|
||||||
|
|
||||||
@@ -53,3 +54,5 @@ The following image tags have been deprecated and are no longer receiving update
|
|||||||
- openj9-nightly
|
- openj9-nightly
|
||||||
- multiarch-latest
|
- multiarch-latest
|
||||||
- java16/java16-openj9
|
- java16/java16-openj9
|
||||||
|
- java17-graalvm-ce
|
||||||
|
- java20-graalvm
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ To use a different Minecraft version, pass the `VERSION` environment variable (c
|
|||||||
|
|
||||||
- LATEST (the default)
|
- LATEST (the default)
|
||||||
- SNAPSHOT
|
- SNAPSHOT
|
||||||
- or a specific version, such as "1.7.9"
|
- a specific version, such as "1.7.9"
|
||||||
|
- or an alpha and beta version, such as "b1.7.3" (server download might not exist)
|
||||||
|
|
||||||
For example, to use the latest snapshot:
|
For example, to use the latest snapshot:
|
||||||
|
|
||||||
|
|||||||
@@ -706,5 +706,5 @@ update-client-command-list: true
|
|||||||
register-command-list-data: true
|
register-command-list-data: true
|
||||||
|
|
||||||
# If LuckPerms should attempt to resolve Vanilla command target selectors for LP commands.
|
# If LuckPerms should attempt to resolve Vanilla command target selectors for LP commands.
|
||||||
# See here for more info: https://minecraft.gamepedia.com/Commands#Target_selectors
|
# See here for more info: https://minecraft.wiki/Commands#Target_selectors
|
||||||
resolve-command-selectors: false
|
resolve-command-selectors: false
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ if isTrue "${DEBUG_AUTOPAUSE}"; then
|
|||||||
knockdArgs+=(-D)
|
knockdArgs+=(-D)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
if isTrue "${AUTOPAUSE_SUDO:-true}"; then
|
||||||
|
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||||
|
else
|
||||||
|
/usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||||
|
fi
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
logAutopause "Failed to start knockd daemon."
|
logAutopause "Failed to start knockd daemon."
|
||||||
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
||||||
|
|||||||
58
files/property-definitions.json
Normal file
58
files/property-definitions.json
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"motd": {"env": "MOTD"},
|
||||||
|
"gamemode": {"env": "MODE"},
|
||||||
|
"difficulty": {"env": "DIFFICULTY"},
|
||||||
|
"white-list": {"env": "WHITELIST_PROP"},
|
||||||
|
"enforce-whitelist": {"env": "ENFORCE_WHITELIST"},
|
||||||
|
"level-type": {"env": "LEVEL_TYPE"},
|
||||||
|
"server-name": {"env": "SERVER_NAME"},
|
||||||
|
"server-ip": {"env": "SERVER_IP"},
|
||||||
|
"server-port": {"env": "SERVER_PORT"},
|
||||||
|
"allow-nether": {"env": "ALLOW_NETHER"},
|
||||||
|
"announce-player-achievements": {"env": "ANNOUNCE_PLAYER_ACHIEVEMENTS"},
|
||||||
|
"enable-command-block": {"env": "ENABLE_COMMAND_BLOCK"},
|
||||||
|
"spawn-animals": {"env": "SPAWN_ANIMALS"},
|
||||||
|
"spawn-monsters": {"env": "SPAWN_MONSTERS"},
|
||||||
|
"spawn-npcs": {"env": "SPAWN_NPCS"},
|
||||||
|
"spawn-protection": {"env": "SPAWN_PROTECTION"},
|
||||||
|
"generate-structures": {"env": "GENERATE_STRUCTURES"},
|
||||||
|
"view-distance": {"env": "VIEW_DISTANCE"},
|
||||||
|
"hardcore": {"env": "HARDCORE"},
|
||||||
|
"snooper-enabled": {"env": "SNOOPER_ENABLED"},
|
||||||
|
"max-build-height": {"env": "MAX_BUILD_HEIGHT"},
|
||||||
|
"force-gamemode": {"env": "FORCE_GAMEMODE"},
|
||||||
|
"max-tick-time": {"env": "MAX_TICK_TIME"},
|
||||||
|
"enable-query": {"env": "ENABLE_QUERY"},
|
||||||
|
"query.port": {"env": "QUERY_PORT"},
|
||||||
|
"enable-rcon": {"env": "ENABLE_RCON"},
|
||||||
|
"rcon.password": {"env": "RCON_PASSWORD"},
|
||||||
|
"rcon.port": {"env": "RCON_PORT"},
|
||||||
|
"max-players": {"env": "MAX_PLAYERS"},
|
||||||
|
"max-world-size": {"env": "MAX_WORLD_SIZE"},
|
||||||
|
"level-name": {"env": "LEVEL"},
|
||||||
|
"level-seed": {"env": "SEED"},
|
||||||
|
"pvp": {"env": "PVP"},
|
||||||
|
"generator-settings": {"env": "GENERATOR_SETTINGS"},
|
||||||
|
"online-mode": {"env": "ONLINE_MODE"},
|
||||||
|
"allow-flight": {"env": "ALLOW_FLIGHT"},
|
||||||
|
"resource-pack": {"env": "RESOURCE_PACK"},
|
||||||
|
"resource-pack-sha1": {"env": "RESOURCE_PACK_SHA1"},
|
||||||
|
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
|
||||||
|
"player-idle-timeout": {"env": "PLAYER_IDLE_TIMEOUT"},
|
||||||
|
"broadcast-console-to-ops": {"env": "BROADCAST_CONSOLE_TO_OPS"},
|
||||||
|
"broadcast-rcon-to-ops": {"env": "BROADCAST_RCON_TO_OPS"},
|
||||||
|
"enable-jmx-monitoring": {"env": "ENABLE_JMX"},
|
||||||
|
"sync-chunk-writes": {"env": "SYNC_CHUNK_WRITES"},
|
||||||
|
"enable-status": {"env": "ENABLE_STATUS"},
|
||||||
|
"entity-broadcast-range-percentage": {"env": "ENTITY_BROADCAST_RANGE_PERCENTAGE"},
|
||||||
|
"function-permission-level": {"env": "FUNCTION_PERMISSION_LEVEL"},
|
||||||
|
"network-compression-threshold": {"env": "NETWORK_COMPRESSION_THRESHOLD"},
|
||||||
|
"op-permission-level": {"env": "OP_PERMISSION_LEVEL"},
|
||||||
|
"prevent-proxy-connections": {"env": "PREVENT_PROXY_CONNECTIONS"},
|
||||||
|
"use-native-transport": {"env": "USE_NATIVE_TRANSPORT"},
|
||||||
|
"simulation-distance": {"env": "SIMULATION_DISTANCE"},
|
||||||
|
"previews-chat": {"env": "PREVIEWS_CHAT"},
|
||||||
|
"enforce-secure-profile": {"env": "ENFORCE_SECURE_PROFILE"},
|
||||||
|
"initial-enabled-packs": {"env": "INITIAL_ENABLED_PACKS"},
|
||||||
|
"initial-disabled-packs": {"env": "INITIAL_DISABLED_PACKS"}
|
||||||
|
}
|
||||||
13
mkdocs.yml
13
mkdocs.yml
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
site_name: Minecraft Server on Docker (Java Edition)
|
site_name: Minecraft Server on Docker (Java Edition)
|
||||||
site_url: https://docker-minecraft-server.readthedocs.io/
|
site_url: https://docker-minecraft-server.readthedocs.io/en/latest/
|
||||||
site_description: Documentation for Minecraft Server on Docker
|
site_description: Documentation for Minecraft Server on Docker
|
||||||
repo_url: https://github.com/itzg/docker-minecraft-server
|
repo_url: https://github.com/itzg/docker-minecraft-server
|
||||||
edit_uri: blob/master/docs/
|
edit_uri: blob/master/docs/
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
features:
|
features:
|
||||||
- navigation.instant
|
|
||||||
- navigation.tracking
|
- navigation.tracking
|
||||||
- navigation.tabs
|
- navigation.tabs
|
||||||
- navigation.tabs.sticky
|
- navigation.tabs.sticky
|
||||||
@@ -54,9 +53,6 @@ copyright: Copyright © itzg 2023.
|
|||||||
plugins:
|
plugins:
|
||||||
- search
|
- search
|
||||||
- autorefs
|
- autorefs
|
||||||
- literate-nav:
|
|
||||||
nav_file: README.md
|
|
||||||
implicit_index: true
|
|
||||||
- mkdocstrings:
|
- mkdocstrings:
|
||||||
handlers:
|
handlers:
|
||||||
python:
|
python:
|
||||||
@@ -68,8 +64,11 @@ plugins:
|
|||||||
show_signature_annotations: true
|
show_signature_annotations: true
|
||||||
# https://github.com/ultrabug/mkdocs-static-i18n
|
# https://github.com/ultrabug/mkdocs-static-i18n
|
||||||
- i18n:
|
- i18n:
|
||||||
default_language: en
|
|
||||||
languages:
|
languages:
|
||||||
en:
|
- locale: en
|
||||||
name: English
|
name: English
|
||||||
build: true
|
build: true
|
||||||
|
default: true
|
||||||
|
- literate-nav:
|
||||||
|
nav_file: README.md
|
||||||
|
implicit_index: true
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
: "${GID:=1000}"
|
: "${GID:=1000}"
|
||||||
|
|
||||||
umask 0002
|
umask 0002
|
||||||
chmod g+w /data
|
|
||||||
|
|
||||||
if isTrue "${ENABLE_RCON:-true}" && ! [ -v RCON_PASSWORD ] && ! [ -v RCON_PASSWORD_FILE ]; then
|
if isTrue "${ENABLE_RCON:-true}" && ! [ -v RCON_PASSWORD ] && ! [ -v RCON_PASSWORD_FILE ]; then
|
||||||
RCON_PASSWORD=$(openssl rand -hex 12)
|
RCON_PASSWORD=$(openssl rand -hex 12)
|
||||||
|
|||||||
@@ -185,6 +185,10 @@ case "${TYPE^^}" in
|
|||||||
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
NEOFORGE|NEOFORGED)
|
||||||
|
exec "${SCRIPTS:-/}start-deployNeoForge" "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
FABRIC)
|
FABRIC)
|
||||||
exec "${SCRIPTS:-/}start-deployFabric" "$@"
|
exec "${SCRIPTS:-/}start-deployFabric" "$@"
|
||||||
;;
|
;;
|
||||||
|
|||||||
30
scripts/start-deployNeoForge
Normal file
30
scripts/start-deployNeoForge
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
: "${NEOFORGE_VERSION:=latest}"
|
||||||
|
: "${NEOFORGE_FORCE_REINSTALL:=false}}"
|
||||||
|
|
||||||
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
resultsFile=/data/.run-neoforge.env
|
||||||
|
|
||||||
|
if ! mc-image-helper install-neoforge \
|
||||||
|
--output-directory=/data \
|
||||||
|
--results-file=${resultsFile} \
|
||||||
|
--minecraft-version="${VERSION}" \
|
||||||
|
--neoforge-version="${NEOFORGE_VERSION}" \
|
||||||
|
--force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
|
||||||
|
log "ERROR failed to install Forge"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# grab SERVER and export it
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source ${resultsFile}
|
||||||
|
set +a
|
||||||
|
|
||||||
|
export FAMILY=FORGE
|
||||||
|
|
||||||
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||||
@@ -221,7 +221,11 @@ function copyFilesForCurseForge() {
|
|||||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||||
}
|
}
|
||||||
|
|
||||||
if versionLessThan 1.7; then
|
if versionLessThan 'b1.8'; then
|
||||||
|
echo "
|
||||||
|
DISABLE_HEALTHCHECK=true
|
||||||
|
" > /data/.mc-health.env
|
||||||
|
elif versionLessThan 1.7; then
|
||||||
echo "
|
echo "
|
||||||
MC_HEALTH_EXTRA_ARGS=(
|
MC_HEALTH_EXTRA_ARGS=(
|
||||||
--use-server-list-ping
|
--use-server-list-ping
|
||||||
|
|||||||
@@ -229,8 +229,12 @@ function handleGenericPacks() {
|
|||||||
|
|
||||||
function handleModrinthProjects() {
|
function handleModrinthProjects() {
|
||||||
: "${MODRINTH_PROJECTS:=}"
|
: "${MODRINTH_PROJECTS:=}"
|
||||||
: "${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES:=true}"
|
|
||||||
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
|
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
|
||||||
|
: "${MODRINTH_DOWNLOAD_DEPENDENCIES:=none}"
|
||||||
|
if [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]; then
|
||||||
|
log "WARNING The variable MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES is removed."
|
||||||
|
log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
||||||
if isFamily HYBRID FORGE; then
|
if isFamily HYBRID FORGE; then
|
||||||
@@ -246,7 +250,7 @@ function handleModrinthProjects() {
|
|||||||
--projects="${MODRINTH_PROJECTS}" \
|
--projects="${MODRINTH_PROJECTS}" \
|
||||||
--game-version="${VERSION}" \
|
--game-version="${VERSION}" \
|
||||||
--loader="$loader" \
|
--loader="$loader" \
|
||||||
--download-optional-dependencies="$MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES" \
|
--download-dependencies="$MODRINTH_DOWNLOAD_DEPENDENCIES" \
|
||||||
--allowed-version-type="$MODRINTH_ALLOWED_VERSION_TYPE"
|
--allowed-version-type="$MODRINTH_ALLOWED_VERSION_TYPE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,21 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
: "${EXISTING_OPS_FILE:=SKIP}"
|
||||||
|
: "${EXISTING_WHITELIST_FILE:=SKIP}"
|
||||||
|
|
||||||
|
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
|
||||||
|
EXISTING_OPS_FILE=MERGE
|
||||||
|
elif [[ -v OVERRIDE_OPS ]] && isTrue "${OVERRIDE_OPS}"; then
|
||||||
|
EXISTING_OPS_FILE=SYNCHRONIZE
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -v APPEND_WHITELIST ]] && isTrue "${APPEND_WHITELIST}"; then
|
||||||
|
EXISTING_WHITELIST_FILE=MERGE
|
||||||
|
elif [[ -v OVERRIDE_WHITELIST ]] && isTrue "${OVERRIDE_WHITELIST}"; then
|
||||||
|
EXISTING_WHITELIST_FILE=SYNCHRONIZE
|
||||||
|
fi
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
# shellcheck source=start-utils
|
||||||
. "${SCRIPTS:-/}start-utils"
|
. "${SCRIPTS:-/}start-utils"
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
@@ -12,10 +27,15 @@ if isFalse "${ONLINE_MODE:-true}"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -v OPS_FILE ]]; then
|
if [[ -v OPS_FILE ]]; then
|
||||||
|
existing="$EXISTING_OPS_FILE"
|
||||||
|
if [[ "$EXISTING_OPS_FILE" = SYNC_FILE_MERGE_LIST ]]; then
|
||||||
|
existing=SYNCHRONIZE
|
||||||
|
fi
|
||||||
mc-image-helper manage-users \
|
mc-image-helper manage-users \
|
||||||
"${sharedArgs[@]}" \
|
"${sharedArgs[@]}" \
|
||||||
--type=JAVA_OPS \
|
--type=JAVA_OPS \
|
||||||
--input-is-file \
|
--input-is-file \
|
||||||
|
--existing="${existing}" \
|
||||||
"$OPS_FILE"
|
"$OPS_FILE"
|
||||||
fi
|
fi
|
||||||
if [[ -v OPS ]]; then
|
if [[ -v OPS ]]; then
|
||||||
@@ -23,29 +43,44 @@ if [[ -v OPS ]]; then
|
|||||||
if isTrue "${APPEND_OPS:-false}" || isFalse "${OVERRIDE_OPS:-true}"; then
|
if isTrue "${APPEND_OPS:-false}" || isFalse "${OVERRIDE_OPS:-true}"; then
|
||||||
args+=(--append-only)
|
args+=(--append-only)
|
||||||
fi
|
fi
|
||||||
|
existing="$EXISTING_OPS_FILE"
|
||||||
|
if [[ "$EXISTING_OPS_FILE" = SYNC_FILE_MERGE_LIST ]]; then
|
||||||
|
existing=MERGE
|
||||||
|
fi
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
mc-image-helper manage-users \
|
mc-image-helper manage-users \
|
||||||
"${sharedArgs[@]}" "${args[@]}" \
|
"${sharedArgs[@]}" "${args[@]}" \
|
||||||
--type=JAVA_OPS \
|
--type=JAVA_OPS \
|
||||||
|
--existing="${existing}" \
|
||||||
$OPS
|
$OPS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -v WHITELIST_FILE ]]; then
|
if [[ -v WHITELIST_FILE ]]; then
|
||||||
|
existing="$EXISTING_WHITELIST_FILE"
|
||||||
|
if [[ "$EXISTING_WHITELIST_FILE" = SYNC_FILE_MERGE_LIST ]]; then
|
||||||
|
existing=SYNCHRONIZE
|
||||||
|
fi
|
||||||
mc-image-helper manage-users \
|
mc-image-helper manage-users \
|
||||||
"${sharedArgs[@]}" \
|
"${sharedArgs[@]}" \
|
||||||
--type=JAVA_WHITELIST \
|
--type=JAVA_WHITELIST \
|
||||||
--input-is-file \
|
--input-is-file \
|
||||||
"$WHITELIST_FILE"
|
--existing="${existing}" \
|
||||||
|
"$WHITELIST_FILE"
|
||||||
fi
|
fi
|
||||||
if [[ -v WHITELIST ]]; then
|
if [[ -v WHITELIST ]]; then
|
||||||
args=()
|
args=()
|
||||||
if isTrue "${APPEND_WHITELIST:-false}" || isFalse "${OVERRIDE_WHITELIST:-true}"; then
|
if isTrue "${APPEND_WHITELIST:-false}" || isFalse "${OVERRIDE_WHITELIST:-true}"; then
|
||||||
args+=(--append-only)
|
args+=(--append-only)
|
||||||
fi
|
fi
|
||||||
|
existing="$EXISTING_WHITELIST_FILE"
|
||||||
|
if [[ "$EXISTING_WHITELIST_FILE" = SYNC_FILE_MERGE_LIST ]]; then
|
||||||
|
existing=MERGE
|
||||||
|
fi
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
mc-image-helper manage-users \
|
mc-image-helper manage-users \
|
||||||
"${sharedArgs[@]}" "${args[@]}" \
|
"${sharedArgs[@]}" "${args[@]}" \
|
||||||
--type=JAVA_WHITELIST \
|
--type=JAVA_WHITELIST \
|
||||||
|
--existing="${existing}" \
|
||||||
$WHITELIST
|
$WHITELIST
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -8,49 +8,18 @@
|
|||||||
: "${SKIP_SERVER_PROPERTIES:=false}"
|
: "${SKIP_SERVER_PROPERTIES:=false}"
|
||||||
: "${ENABLE_WHITELIST:=}"
|
: "${ENABLE_WHITELIST:=}"
|
||||||
|
|
||||||
# FUNCTIONS
|
|
||||||
function setServerPropValue {
|
|
||||||
local prop=$1
|
|
||||||
local value=$2
|
|
||||||
# normalize booleans
|
|
||||||
case ${value^^} in
|
|
||||||
TRUE|FALSE)
|
|
||||||
value=${value,,} ;;
|
|
||||||
esac
|
|
||||||
if [[ $prop =~ password ]]; then
|
|
||||||
showValue="*****"
|
|
||||||
else
|
|
||||||
showValue="$value"
|
|
||||||
fi
|
|
||||||
if [ -f "$SERVER_PROPERTIES" ] && grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
|
||||||
debug "Setting ${prop} to '${showValue}' in ${SERVER_PROPERTIES}"
|
|
||||||
sed -i "/^${prop}\s*=/ c ${prop}=${value//\\/\\\\}" "$SERVER_PROPERTIES"
|
|
||||||
else
|
|
||||||
debug "Adding ${prop} with '${showValue}' in ${SERVER_PROPERTIES}"
|
|
||||||
echo "${prop}=${value}" >> "$SERVER_PROPERTIES"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function setServerProp {
|
|
||||||
local prop=$1
|
|
||||||
local varName=$2
|
|
||||||
|
|
||||||
if [ -v $varName ]; then
|
|
||||||
setServerPropValue "$prop" "${!varName}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function customizeServerProps {
|
function customizeServerProps {
|
||||||
local firstSetup=$1
|
local firstSetup=$1
|
||||||
# Whitelist processing
|
# Whitelist processing
|
||||||
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST}"; then
|
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST}"; then
|
||||||
log "Enabling whitelist functionality"
|
log "Enabling whitelist functionality"
|
||||||
setServerPropValue "white-list" "true"
|
WHITELIST_PROP=true
|
||||||
setServerPropValue "enforce-whitelist" "true"
|
ENFORCE_WHITELIST=true
|
||||||
|
export WHITELIST_PROP ENFORCE_WHITELIST
|
||||||
elif isTrue "$firstSetup" || isFalse "${ENABLE_WHITELIST}"; then
|
elif isTrue "$firstSetup" || isFalse "${ENABLE_WHITELIST}"; then
|
||||||
log "Disabling whitelist functionality"
|
log "Disabling whitelist functionality"
|
||||||
setServerPropValue "white-list" "false"
|
WHITELIST_PROP=false
|
||||||
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
|
export WHITELIST_PROP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# normalize MOTD
|
# normalize MOTD
|
||||||
@@ -59,101 +28,11 @@ function customizeServerProps {
|
|||||||
MOTD="{\"text\":\"${MOTD}\"}"
|
MOTD="{\"text\":\"${MOTD}\"}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setServerProp "server-name" SERVER_NAME
|
|
||||||
setServerProp "server-ip" SERVER_IP
|
|
||||||
setServerProp "server-port" SERVER_PORT
|
|
||||||
setServerProp "allow-nether" ALLOW_NETHER
|
|
||||||
setServerProp "announce-player-achievements" ANNOUNCE_PLAYER_ACHIEVEMENTS
|
|
||||||
setServerProp "enable-command-block" ENABLE_COMMAND_BLOCK
|
|
||||||
setServerProp "spawn-animals" SPAWN_ANIMALS
|
|
||||||
setServerProp "spawn-monsters" SPAWN_MONSTERS
|
|
||||||
setServerProp "spawn-npcs" SPAWN_NPCS
|
|
||||||
setServerProp "spawn-protection" SPAWN_PROTECTION
|
|
||||||
setServerProp "generate-structures" GENERATE_STRUCTURES
|
|
||||||
setServerProp "view-distance" VIEW_DISTANCE
|
|
||||||
setServerProp "hardcore" HARDCORE
|
|
||||||
setServerProp "snooper-enabled" SNOOPER_ENABLED
|
|
||||||
setServerProp "max-build-height" MAX_BUILD_HEIGHT
|
|
||||||
setServerProp "force-gamemode" FORCE_GAMEMODE
|
|
||||||
setServerProp "max-tick-time" MAX_TICK_TIME
|
|
||||||
setServerProp "enable-query" ENABLE_QUERY
|
|
||||||
setServerProp "query.port" QUERY_PORT
|
|
||||||
setServerProp "enable-rcon" ENABLE_RCON
|
|
||||||
setServerProp "rcon.password" RCON_PASSWORD
|
|
||||||
setServerProp "rcon.port" RCON_PORT
|
|
||||||
setServerProp "max-players" MAX_PLAYERS
|
|
||||||
setServerProp "max-world-size" MAX_WORLD_SIZE
|
|
||||||
setServerProp "level-name" LEVEL
|
|
||||||
setServerProp "level-seed" SEED
|
|
||||||
setServerProp "pvp" PVP
|
|
||||||
setServerProp "generator-settings" GENERATOR_SETTINGS
|
|
||||||
setServerProp "online-mode" ONLINE_MODE
|
|
||||||
setServerProp "allow-flight" ALLOW_FLIGHT
|
|
||||||
setServerProp "resource-pack" RESOURCE_PACK
|
|
||||||
setServerProp "resource-pack-sha1" RESOURCE_PACK_SHA1
|
|
||||||
setServerProp "require-resource-pack" RESOURCE_PACK_ENFORCE
|
|
||||||
setServerProp "player-idle-timeout" PLAYER_IDLE_TIMEOUT
|
|
||||||
setServerProp "broadcast-console-to-ops" BROADCAST_CONSOLE_TO_OPS
|
|
||||||
setServerProp "broadcast-rcon-to-ops" BROADCAST_RCON_TO_OPS
|
|
||||||
setServerProp "enable-jmx-monitoring" ENABLE_JMX
|
|
||||||
setServerProp "sync-chunk-writes" SYNC_CHUNK_WRITES
|
|
||||||
setServerProp "enable-status" ENABLE_STATUS
|
|
||||||
setServerProp "entity-broadcast-range-percentage" ENTITY_BROADCAST_RANGE_PERCENTAGE
|
|
||||||
setServerProp "function-permission-level" FUNCTION_PERMISSION_LEVEL
|
|
||||||
setServerProp "network-compression-threshold" NETWORK_COMPRESSION_THRESHOLD
|
|
||||||
setServerProp "op-permission-level" OP_PERMISSION_LEVEL
|
|
||||||
setServerProp "prevent-proxy-connections" PREVENT_PROXY_CONNECTIONS
|
|
||||||
setServerProp "use-native-transport" USE_NATIVE_TRANSPORT
|
|
||||||
setServerProp "simulation-distance" SIMULATION_DISTANCE
|
|
||||||
setServerProp "previews-chat" PREVIEWS_CHAT
|
|
||||||
setServerProp "enforce-secure-profile" ENFORCE_SECURE_PROFILE
|
|
||||||
setServerProp "initial-enabled-packs" INITIAL_ENABLED_PACKS
|
|
||||||
setServerProp "initial-disabled-packs" INITIAL_DISABLED_PACKS
|
|
||||||
if [[ $MOTD ]]; then
|
if [[ $MOTD ]]; then
|
||||||
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
|
MOTD="$(echo "$MOTD" | mc-image-helper asciify)"
|
||||||
fi
|
|
||||||
[[ $LEVEL_TYPE ]] && setServerPropValue "level-type" "${LEVEL_TYPE^^}"
|
|
||||||
|
|
||||||
if [ -n "$DIFFICULTY" ]; then
|
|
||||||
case ${DIFFICULTY,,} in
|
|
||||||
peaceful|0)
|
|
||||||
if versionLessThan 1.13; then
|
|
||||||
DIFFICULTY=0
|
|
||||||
else
|
|
||||||
DIFFICULTY=peaceful
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
easy|1)
|
|
||||||
if versionLessThan 1.13; then
|
|
||||||
DIFFICULTY=1
|
|
||||||
else
|
|
||||||
DIFFICULTY=easy
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
normal|2)
|
|
||||||
if versionLessThan 1.13; then
|
|
||||||
DIFFICULTY=2
|
|
||||||
else
|
|
||||||
DIFFICULTY=normal
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
hard|3)
|
|
||||||
if versionLessThan 1.13; then
|
|
||||||
DIFFICULTY=3
|
|
||||||
else
|
|
||||||
DIFFICULTY=hard
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
setServerPropValue "difficulty" "$DIFFICULTY"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MODE" ]; then
|
if [[ -v MODE ]]; then
|
||||||
log "Setting mode"
|
log "Setting mode"
|
||||||
case ${MODE,,} in
|
case ${MODE,,} in
|
||||||
su*|0)
|
su*|0)
|
||||||
@@ -189,8 +68,58 @@ function customizeServerProps {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
setServerPropValue "gamemode" "$MODE"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -v DIFFICULTY ]]; then
|
||||||
|
case ${DIFFICULTY,,} in
|
||||||
|
peaceful|0)
|
||||||
|
if versionLessThan 1.13; then
|
||||||
|
DIFFICULTY=0
|
||||||
|
else
|
||||||
|
DIFFICULTY=peaceful
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
easy|1)
|
||||||
|
if versionLessThan 1.13; then
|
||||||
|
DIFFICULTY=1
|
||||||
|
else
|
||||||
|
DIFFICULTY=easy
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
normal|2)
|
||||||
|
if versionLessThan 1.13; then
|
||||||
|
DIFFICULTY=2
|
||||||
|
else
|
||||||
|
DIFFICULTY=normal
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
hard|3)
|
||||||
|
if versionLessThan 1.13; then
|
||||||
|
DIFFICULTY=3
|
||||||
|
else
|
||||||
|
DIFFICULTY=hard
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -v LEVEL_TYPE ]]; then
|
||||||
|
LEVEL_TYPE="${LEVEL_TYPE^^}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
setPropertiesArgs=(
|
||||||
|
--definitions "/image/property-definitions.json"
|
||||||
|
)
|
||||||
|
if [[ -v CUSTOM_SERVER_PROPERTIES ]]; then
|
||||||
|
setPropertiesArgs+=(--custom-properties "$CUSTOM_SERVER_PROPERTIES")
|
||||||
|
fi
|
||||||
|
|
||||||
|
mc-image-helper set-properties "${setPropertiesArgs[@]}" "$SERVER_PROPERTIES"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deploy server.properties file
|
# Deploy server.properties file
|
||||||
|
|||||||
Reference in New Issue
Block a user