mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f84ae66af3 | ||
|
|
58face9c1b | ||
|
|
b8e6eea265 | ||
|
|
78b55df635 | ||
|
|
0f9941373b | ||
|
|
6ac313ae71 | ||
|
|
bc0a87cc53 | ||
|
|
5baf398af3 | ||
|
|
8dac5d1428 | ||
|
|
4232a981e8 | ||
|
|
b89c698676 | ||
|
|
8a5b5bbe70 | ||
|
|
11d8d917f2 | ||
|
|
2023f5aa31 | ||
|
|
bcd8db1306 | ||
|
|
62ce504da3 | ||
|
|
c87145a5e4 | ||
|
|
c4f69bf577 | ||
|
|
67b790dfed | ||
|
|
a55d575375 | ||
|
|
70cc1298c2 | ||
|
|
b9a61c8852 | ||
|
|
75496d6e0b | ||
|
|
50caaf98ef | ||
|
|
14a8f903ae | ||
|
|
c70f9c3fff | ||
|
|
a933e92460 | ||
|
|
4c42a3e46c | ||
|
|
1ccd6a0954 | ||
|
|
c3614466e7 | ||
|
|
3349df764e | ||
|
|
d3725c3388 | ||
|
|
63e8d33f6c | ||
|
|
a8b7ad533c | ||
|
|
fe5f066a0b | ||
|
|
47c2b60cba | ||
|
|
db88d167fe | ||
|
|
774d3bc717 | ||
|
|
c365a6cc5a | ||
|
|
cafb80eec3 | ||
|
|
bc789202a1 | ||
|
|
2e9be596f7 | ||
|
|
87afad69b3 | ||
|
|
fa058a18ad | ||
|
|
3936d56583 | ||
|
|
ca8abe3e16 | ||
|
|
ed7a6668aa | ||
|
|
c828985ebe | ||
|
|
8fd98f0315 | ||
|
|
708b6ab849 | ||
|
|
524ac1d0ec | ||
|
|
2cf4b98d76 |
24
.github/workflows/build-multiarch.yml
vendored
24
.github/workflows/build-multiarch.yml
vendored
@@ -21,10 +21,10 @@ jobs:
|
||||
variant:
|
||||
- java21-graalvm
|
||||
- java21
|
||||
- java21-jdk
|
||||
- java21-alpine
|
||||
- java17
|
||||
- java17-graalvm
|
||||
- java17-jdk
|
||||
- java17-alpine
|
||||
- java8
|
||||
- java8-graalvm-ce
|
||||
@@ -42,6 +42,10 @@ jobs:
|
||||
baseImage: eclipse-temurin:21-jre
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: latest
|
||||
- variant: java21-jdk
|
||||
baseImage: eclipse-temurin:21
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: latest
|
||||
- variant: java21-alpine
|
||||
baseImage: eclipse-temurin:21-jre-alpine
|
||||
platforms: linux/amd64,linux/arm64
|
||||
@@ -56,10 +60,6 @@ jobs:
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol8
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.20.4
|
||||
- variant: java17-jdk
|
||||
baseImage: eclipse-temurin:17-focal
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.20.4
|
||||
- variant: java17-alpine
|
||||
baseImage: eclipse-temurin:17-jre-alpine
|
||||
platforms: linux/amd64
|
||||
@@ -97,7 +97,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.6
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
@@ -132,13 +132,13 @@ jobs:
|
||||
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.3.0
|
||||
uses: docker/setup-buildx-action@v3.4.0
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.0.0
|
||||
uses: docker/setup-qemu-action@v3.1.0
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
uses: docker/build-push-action@v6.3.0
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
@@ -161,14 +161,14 @@ jobs:
|
||||
tests/test.sh
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3.1.0
|
||||
uses: docker/login-action@v3.2.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3.1.0
|
||||
uses: docker/login-action@v3.2.0
|
||||
if: env.HAS_IMAGE_REPO_ACCESS
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
uses: docker/build-push-action@v6.3.0
|
||||
if: github.actor == github.repository_owner
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
|
||||
8
.github/workflows/verify-pr.yml
vendored
8
.github/workflows/verify-pr.yml
vendored
@@ -46,16 +46,16 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.6
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.3.0
|
||||
uses: docker/setup-buildx-action@v3.4.0
|
||||
|
||||
- name: Confirm multi-arch build
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
uses: docker/build-push-action@v6.3.0
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
# ensure latest base image is used
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
uses: docker/build-push-action@v6.3.0
|
||||
with:
|
||||
# Only build single platform since loading multi-arch image into daemon fails with
|
||||
# "docker exporter does not currently support exporting manifest lists"
|
||||
|
||||
12
Dockerfile
12
Dockerfile
@@ -23,31 +23,31 @@ EXPOSE 25565
|
||||
ARG APPS_REV=1
|
||||
ARG GITHUB_BASEURL=https://github.com
|
||||
|
||||
ARG EASY_ADD_VERSION=0.8.5
|
||||
ARG EASY_ADD_VERSION=0.8.7
|
||||
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
RUN chmod +x /usr/bin/easy-add
|
||||
|
||||
ARG RESTIFY_VERSION=1.7.2
|
||||
ARG RESTIFY_VERSION=1.7.4
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG RCON_CLI_VERSION=1.6.6
|
||||
ARG RCON_CLI_VERSION=1.6.7
|
||||
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.11
|
||||
ARG MC_MONITOR_VERSION=0.12.13
|
||||
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.12.1
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.12.2
|
||||
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.38.15
|
||||
ARG MC_HELPER_VERSION=1.39.7
|
||||
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
|
||||
|
||||
@@ -13,6 +13,6 @@ elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' |
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
mc-monitor status "${MC_HEALTH_EXTRA_ARGS[@]}" --host localhost --port "${SERVER_PORT:-25565}"
|
||||
mc-monitor status "${MC_HEALTH_EXTRA_ARGS[@]}" --host "${SERVER_HOST:-localhost}" --port "${SERVER_PORT:-25565}"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
@@ -55,6 +55,14 @@ To allow time for players to finish what they're doing during a graceful server
|
||||
|
||||
The grace period can be increased using [the -t option on docker-compose down](https://docs.docker.com/compose/reference/down/) or set the [stop_grace_period](https://docs.docker.com/compose/compose-file/05-services/#stop_grace_period) in the compose file.
|
||||
|
||||
## Configuration Options for Minecraft Server Health Monitoring
|
||||
|
||||
The image tags include specific variables to simplify configuration for monitoring the health of a Minecraft server:
|
||||
|
||||
- `-e SERVER_HOST=localhost` : This variable sets the host address of the Minecraft server to be monitored. By default, it is set to `localhost`, but you can replace it with the actual hostname or IP address of your Minecraft server.
|
||||
|
||||
- `-e SERVER_PORT=25565` : This variable sets the port number on which the Minecraft server is running. By default, Minecraft servers run on port 25565, but if your server is configured to use a different port, you should replace `25565` with the correct port number. This helps the monitoring system to accurately check the health status of the Minecraft server on the specified port.
|
||||
|
||||
## OpenJ9 Specific Options
|
||||
|
||||
The openj9 image tags include specific variables to simplify configuration:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
|
||||
|
||||
!!! note
|
||||
!!! note
|
||||
|
||||
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
|
||||
|
||||
@@ -25,3 +25,6 @@ The following environment variables define the behavior of auto-stopping:
|
||||
describes period of the daemonized state machine, that handles the stopping of the server
|
||||
|
||||
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
|
||||
|
||||
## Proxy Support
|
||||
If you make use of PROXY Protocol, i.e. through something like HAProxy or Fly.io, you will need to enable it in your variety of server's configuration, and then set the `USES_PROXY_PROTOCOL` envar to `true`. This lets Autostop monitor the server, where it otherwise wouldn't
|
||||
|
||||
@@ -6,7 +6,7 @@ Docker image that runs a Minecraft Bedrock server.
|
||||
|
||||
Lightweight multiplexer/proxy for Minecraft Java servers. Provided as a stand-alone application and a Docker image.
|
||||
|
||||
### [itzg/bungeecord](https://github.com/itzg/docker-bungeecord/)
|
||||
### [itzg/mc-proxy](https://github.com/itzg/docker-bungeecord/)
|
||||
|
||||
Docker image that runs a proxy powered by Bungeecord, Velocity, or Waterfall
|
||||
|
||||
|
||||
@@ -47,3 +47,7 @@ naturalist
|
||||
aquaculture
|
||||
naturalist
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
The files processing can detect if a dependency is missing from the given list, but is not able to resolve the dependencies otherwise since their metadata only gives the mod ID and not the specific file version/ID that is needed.
|
||||
|
||||
@@ -117,7 +117,7 @@ https://edge.forgecdn.net/files/2871/647/ToastControl-1.15.2-3.0.1.jar
|
||||
|
||||
Blank lines and lines that start with a `#` will be ignored
|
||||
|
||||
[This compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-mods-file.yml) shows another example of using this feature.
|
||||
[This compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/mods-file/docker-compose.yml) shows another example of using this feature.
|
||||
|
||||
## Remove old mods/plugins
|
||||
|
||||
|
||||
@@ -26,5 +26,5 @@
|
||||
: Can be set to `none` (the default), `required`, or `optional` to download required and/or optional dependencies.
|
||||
|
||||
`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`. Setting to `beta` will pick up both release and beta versions. Setting to `alpha` will pick up release, beta, and alpha versions.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
mkdocs-material == 9.5.24
|
||||
mkdocs-material == 9.5.28
|
||||
mkdocs-autorefs == 1.0.1
|
||||
mkdocstrings == 0.25.1
|
||||
mkdocs-literate-nav == 0.6.1
|
||||
|
||||
@@ -73,6 +73,10 @@ To force include client mods, set `MODRINTH_FORCE_INCLUDE_FILES` to a comma or n
|
||||
yet-another-config-lib
|
||||
```
|
||||
|
||||
## Default exclude/includes
|
||||
|
||||
The image comes with a default set of exclude/includes, maintained [in the repo files area](https://github.com/itzg/docker-minecraft-server/blob/master/files/modrinth-exclude-include.json) and uses the same [JSON schema](https://github.com/itzg/mc-image-helper?tab=readme-ov-file#excludeinclude-file-schema) as Auto CurseForge. Those defaults can be disabled by setting the env var `MODRINTH_DEFAULT_EXCLUDE_INCLUDES` to an empty string.
|
||||
|
||||
## Excluding Overrides Files
|
||||
|
||||
Modrinth mrpack/zip files may include an `overrides` subdirectory that contains config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `MODRINTH_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
|
||||
A [PaperMC server](https://papermc.io/) can be automatically downloaded, upgraded, and run by setting the environment variable TYPE to "PAPER".
|
||||
|
||||
By default, the container will run the latest build of [Paper server](https://papermc.io/downloads) but you can also choose to run a specific build with `-e PAPERBUILD=205`.
|
||||
By default, the container will find and download the latest build for the `VERSION` chosen. If `VERSION` is not specified, then the latest Minecraft version released by PaperMC is selected. Along with a specific `VERSION`, a specific Paper build can be selected by setting the environment variable `PAPER_BUILD`.
|
||||
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=PAPER \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "experimental", otherwise only release/default channel builds are selected.
|
||||
|
||||
!!! example
|
||||
|
||||
```
|
||||
docker run ... -e TYPE=PAPER ...
|
||||
|
||||
docker run ... -e TYPE=PAPER -e VERSION=1.20.6 ...
|
||||
|
||||
docker run ... -e TYPE=PAPER -e VERSION=1.20.6 -e PAPER_BUILD=140 ...
|
||||
|
||||
docker run ... -e TYPE=PAPER -e PAPER_CHANNEL=experimental ...
|
||||
```
|
||||
|
||||
If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`.
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>BROADCAST_RCON_TO_OPS</code></td>
|
||||
<td>Should RCON be enabled</td>
|
||||
<td>Sets broadcast-rcon-to-ops server property</td>
|
||||
<td><code>false</code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
|
||||
@@ -15,10 +15,10 @@ where `<tag>` refers to the first column of this table:
|
||||
| latest | 21 | Ubuntu | Hotspot | amd64, arm64 |
|
||||
| stable | 21 | Ubuntu | Hotspot | amd64, arm64 |
|
||||
| java21 | 21 | Ubuntu | Hotspot | amd64, arm64 |
|
||||
| java21-jdk | 21 | Ubuntu | Hotspot+JDK | amd64, arm64 |
|
||||
| java21-alpine | 21 | Alpine | Hotspot | amd64, arm64 |
|
||||
| java21-graalvm | 21 | Oracle | Oracle GraalVM[^1] | amd64, arm64 |
|
||||
| java17 | 17 | Ubuntu | Hotspot | amd64, arm64, armv7 |
|
||||
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64, arm64, armv7 |
|
||||
| java17-graalvm | 17 | Oracle | Oracle GraalVM[^1] | amd64, arm64 |
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) |
|
||||
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 |
|
||||
@@ -80,6 +80,18 @@ The `stable` image tag combines the benefits of `latest` and [release versions](
|
||||
|
||||
[This section in the Minecraft wiki](https://minecraft.wiki/w/Tutorials/Update_Java#Why_update?) lists out versions of **vanilla** Minecraft versions and the corresponding Java version that is required.
|
||||
|
||||
### Class file version 65.0
|
||||
|
||||
If encountering a startup failure similar to the following examples, then ensure that the latest image has been re-pulled to use a Java 21. Alternatively, set the image tag specifically to `itzg/minecraft-server:java21`.
|
||||
|
||||
> Exception in thread "ServerMain" java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
|
||||
|
||||
or
|
||||
|
||||
> Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
|
||||
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
|
||||
|
||||
|
||||
### Forge versions
|
||||
|
||||
Forge and its mods sometimes utilize non-public APIs of the JVM and as such are suspceptible to becoming broken with newer Java versions.
|
||||
|
||||
@@ -16,21 +16,6 @@ services:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
- ./downloads:/downloads
|
||||
# Manually download the following and put into the 'downloads' directory next to this compose file
|
||||
#
|
||||
# Mod Filename Download page
|
||||
# =========================== ========================================= ====================================================================================
|
||||
# Fish of Thieves [Fabric 1.20.1] Fish of Thieves v3.0.3 https://www.curseforge.com/minecraft/mc-mods/fish-of-thieves/files/4958329
|
||||
# Only Hammers [FORGE/FABRIC] OnlyHammers-1.20.1-0.6-Fabric https://www.curseforge.com/minecraft/mc-mods/only-hammers-forge-fabric/files/4832068
|
||||
# Sprinklerz sprinklerz-0.5_fabric.jar https://www.curseforge.com/minecraft/mc-mods/sprinklerz/files/4835664
|
||||
# Frog Legs (Fabric/Forge) FrogLegs-v2.0.0-1.20.1-Fabric.jar https://www.curseforge.com/minecraft/mc-mods/froglegs/files/4917818
|
||||
# TrimsEffects [FABRIC] TrimsEffects - MC 1.20.X - 1.1.0 https://www.curseforge.com/minecraft/mc-mods/trimseffects/files/4954156
|
||||
# Display Case Display Case-fabric-1.20-1.0.8.jar https://www.curseforge.com/minecraft/mc-mods/displaycase/files/4921333
|
||||
# Structory: Towers Structory Towers 1.20.4 v1.0.6 https://www.curseforge.com/minecraft/mc-mods/structory-towers/files/4937875
|
||||
# Packet Fixer Packet Fixer Fabric 1.2.1 https://www.curseforge.com/minecraft/mc-mods/packet-fixer/files/4884316
|
||||
# Perfect Plushies Perfect Plushies 1.9.0 [Fabric] https://www.curseforge.com/minecraft/mc-mods/perfect-plushies/files/4985767
|
||||
# Structory Structory 1.20.2 v1.3.4 https://www.curseforge.com/minecraft/mc-mods/structory/files/4937872
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
image: itzg/minecraft-server:java17
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
@@ -9,11 +9,10 @@ services:
|
||||
# allocate from https://console.curseforge.com/ and set in .env file
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||
CF_FILENAME_MATCHER: "1.0.6"
|
||||
# CF_FILENAME_MATCHER: "1.1.0"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
- ../downloads:/downloads
|
||||
# Since Docker's default volume driver creates volumes owned by root, this
|
||||
# init container will change ownership to match final UID of mc service, above
|
||||
init-filebrowser:
|
||||
|
||||
@@ -14,7 +14,6 @@ services:
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
- ./downloads:/downloads
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:java8-multiarch
|
||||
image: itzg/minecraft-server:java8
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
@@ -43,7 +43,6 @@ services:
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
- ./downloads:/downloads
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
@@ -7,11 +7,10 @@ services:
|
||||
# Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_SLUG: better-mc-fabric-bmc1
|
||||
CF_FILENAME_MATCHER: v18.5
|
||||
# CF_FILENAME_MATCHER: v18.5
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc:/data
|
||||
- ../downloads:/downloads
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
|
||||
@@ -2,22 +2,14 @@ services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:java17
|
||||
environment:
|
||||
DEBUG: true
|
||||
SETUP_ONLY: true
|
||||
EULA: true
|
||||
TYPE: MODRINTH
|
||||
VERSION: 1.20.1
|
||||
MEMORY: 4G
|
||||
MODRINTH_MODPACK: better-mc-forge-bmc4
|
||||
MODRINTH_VERSION: v26
|
||||
MODRINTH_EXCLUDE_FILES: |
|
||||
citresewn
|
||||
oculus
|
||||
yungsmenutweaks
|
||||
notenoughanimations
|
||||
ryoamiclights
|
||||
euphoriapatcher
|
||||
entity_model_features
|
||||
entity_texture_features
|
||||
3dskinlayers
|
||||
connector
|
||||
MODRINTH_VERSION: v28
|
||||
MODRINTH_OVERRIDES_EXCLUSIONS: |
|
||||
mods/NekosEnchantedBooks-*.jar
|
||||
mods/citresewn-*.jar
|
||||
|
||||
@@ -8,7 +8,6 @@ services:
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ENABLE_AUTOPAUSE: "TRUE"
|
||||
OVERRIDE_SERVER_PROPERTIES: "TRUE"
|
||||
MAX_TICK_TIME: "-1"
|
||||
# More aggressive settings for demo purposes
|
||||
AUTOPAUSE_TIMEOUT_INIT: "30"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
proxy:
|
||||
image: itzg/bungeecord
|
||||
image: itzg/mc-proxy
|
||||
environment:
|
||||
TYPE: WATERFALL
|
||||
ports:
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
- ./waterfall-config:/config
|
||||
# If you want to use Velocity here is a premade version that supports Velocity
|
||||
# velocity-proxy:
|
||||
# image: itzg/bungeecord
|
||||
# image: itzg/mc-proxy
|
||||
# environment:
|
||||
# TYPE: VELOCITY
|
||||
# ports:
|
||||
|
||||
18
examples/prominence2/docker-compose.yml
Normal file
18
examples/prominence2/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
# allocate from https://console.curseforge.com/ and set in .env file
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/prominence-2-rpg
|
||||
CF_FILENAME_MATCHER: "2.8.7"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
@@ -13,38 +13,21 @@ services:
|
||||
# Optional: select a specific version/file
|
||||
#CF_FILENAME_MATCHER: "0.2.34"
|
||||
CF_EXCLUDE_MODS: |
|
||||
auudio-forge
|
||||
betterf3
|
||||
better-third-person
|
||||
clickable-advancements
|
||||
controlling
|
||||
craftpresence
|
||||
creative-core
|
||||
default-options
|
||||
drippy-loading-screen
|
||||
embeddium
|
||||
embeddium-extension
|
||||
embeddium-extras
|
||||
equipment-compare
|
||||
ezzoom
|
||||
fading-night-vision
|
||||
fancymenu
|
||||
item-borders
|
||||
itemphysic-lite
|
||||
just-enough-resources-jer
|
||||
konkrete
|
||||
legendary-tooltips
|
||||
mouse-tweaks
|
||||
oauth
|
||||
oculus
|
||||
sound-filters
|
||||
textrues-embeddium-options
|
||||
toast-control
|
||||
CF_FORCE_SYNCHRONIZE: "true"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
- ./downloads:/downloads
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# NOTE
|
||||
# This file is named spiget with an "e"
|
||||
# since it provides an example of the
|
||||
# This file is purposely named spiget with an "e" since it provides an example of the
|
||||
# feature https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/spiget/
|
||||
# which uses the Spiget API at https://spiget.org/
|
||||
|
||||
@@ -13,8 +12,6 @@ services:
|
||||
EULA: "TRUE"
|
||||
TYPE: PAPER
|
||||
SPIGET_RESOURCES: 34315,3836
|
||||
REMOVE_OLD_MODS: true
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
- ./data:/data
|
||||
@@ -16,10 +16,6 @@ services:
|
||||
ENABLE_COMMAND_BLOCK: true
|
||||
DIFFICULTY: hard
|
||||
volumes:
|
||||
# Need to place non-distributable mods in ./downloads/mods
|
||||
# As of Update-10.0.0
|
||||
# - Neon Craft 2 v2.2: https://www.curseforge.com/minecraft/mc-mods/neon-craft-2-mod/files/3726051
|
||||
- ./downloads:/downloads
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=../scripts/start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
current_uptime() {
|
||||
awk '{print $1}' /proc/uptime | cut -d . -f 1
|
||||
}
|
||||
@@ -16,14 +18,20 @@ rcon_client_exists() {
|
||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||
}
|
||||
|
||||
use_proxy() {
|
||||
if isTrue "$USES_PROXY_PROTOCOL"; then
|
||||
echo "--use-proxy"
|
||||
fi
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
mc-monitor status --host localhost --port "$SERVER_PORT" --timeout 10s >& /dev/null
|
||||
mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >&/dev/null
|
||||
}
|
||||
|
||||
java_clients_connections() {
|
||||
local connections
|
||||
if java_running ; then
|
||||
if ! connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count); then
|
||||
if java_running; then
|
||||
if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then
|
||||
# consider it a non-zero player count if the ping fails
|
||||
# otherwise a laggy server with players connected could get paused
|
||||
connections=1
|
||||
|
||||
@@ -1,29 +1,64 @@
|
||||
{
|
||||
"globalExcludes": [
|
||||
"ambientsounds",
|
||||
"auudio-forge",
|
||||
"ambience-music-mod",
|
||||
"appleskin",
|
||||
"armor-chroma",
|
||||
"armor-toughness-bar",
|
||||
"beehivetooltips",
|
||||
"better-advancements",
|
||||
"betterf3",
|
||||
"betterfps",
|
||||
"better-foliage",
|
||||
"better-placement",
|
||||
"better-sprinting",
|
||||
"better-tips-nbt-tag",
|
||||
"better-third-person",
|
||||
"biomeinfo",
|
||||
"block-drops-jei-addon",
|
||||
"cherished-worlds",
|
||||
"chunk-animator",
|
||||
"clickable-advancements",
|
||||
"configured",
|
||||
"controlling",
|
||||
"ctm",
|
||||
"custom-main-menu",
|
||||
"defensive-measures",
|
||||
"ding",
|
||||
"drippy-loading-screen",
|
||||
"dynamiclights-reforged",
|
||||
"dynamic-surroundings",
|
||||
"easiervillagertrading",
|
||||
"effective-forge",
|
||||
"embeddium",
|
||||
"embeddium-extension",
|
||||
"embeddium-extras",
|
||||
"enchantment-descriptions",
|
||||
"entity-collision-fps-fix",
|
||||
"entity-texture-features-fabric",
|
||||
"entityculling",
|
||||
"extreme-sound-muffler",
|
||||
"ezzoom",
|
||||
"fading-night-vision",
|
||||
"falling-leaves-forge",
|
||||
"fancymenu",
|
||||
"faster-ladder-climbing",
|
||||
"foamfix-optimization-mod",
|
||||
"free-cam",
|
||||
"ftb-backups-2",
|
||||
"fullscreen-windowed-borderless-for-minecraft",
|
||||
"hwyla",
|
||||
"ignitioncoil",
|
||||
"inmisaddon",
|
||||
"irisshaders",
|
||||
"iris-flywheel-compat",
|
||||
"item-obliterator",
|
||||
"itemzoom",
|
||||
"just-enough-harvestcraft",
|
||||
"just-enough-resources-jer",
|
||||
"legendary-tooltips",
|
||||
"lootbeams",
|
||||
"loot-capacitor-tooltips",
|
||||
"magnesium-extras",
|
||||
"menumobs",
|
||||
@@ -33,6 +68,7 @@
|
||||
"neat",
|
||||
"nekos-enchanted-books",
|
||||
"no-recipe-book",
|
||||
"no-nv-flash",
|
||||
"not-enough-animations",
|
||||
"oculus",
|
||||
"oldjavawarning",
|
||||
@@ -42,13 +78,30 @@
|
||||
"resource-reloader",
|
||||
"rubidium",
|
||||
"rubidium-extra",
|
||||
"ryoamiclights",
|
||||
"schematica",
|
||||
"searchables",
|
||||
"shulkerboxviewer",
|
||||
"skin-layers-3d",
|
||||
"smart-hud",
|
||||
"smooth-font",
|
||||
"smoothwater",
|
||||
"sodium",
|
||||
"sound-filters",
|
||||
"sound-physics-remastered",
|
||||
"stellar-sky",
|
||||
"swingthroughgrass",
|
||||
"textrues-embeddium-options",
|
||||
"textrues-rubidium-options",
|
||||
"thaumic-jei",
|
||||
"tips",
|
||||
"torohealth-damage-indicators",
|
||||
"waila-harvestability"
|
||||
"true-darkness",
|
||||
"ungrab-mouse-mod",
|
||||
"vanillafix",
|
||||
"visuality",
|
||||
"waila-harvestability",
|
||||
"zume"
|
||||
],
|
||||
"modpacks": {
|
||||
"all-of-fabric-6": {
|
||||
|
||||
79
files/modrinth-exclude-include.json
Normal file
79
files/modrinth-exclude-include.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"globalExcludes": [
|
||||
"3dskinlayers",
|
||||
"ae2-emi-crafting",
|
||||
"AmbientSounds",
|
||||
"amecs",
|
||||
"Animation_Overhaul",
|
||||
"appleskin",
|
||||
"auudio",
|
||||
"axolotlbuckets",
|
||||
"BadOptimizations",
|
||||
"BetterAdvancements",
|
||||
"betterbeds",
|
||||
"BetterThirdPerson",
|
||||
"BHMenu",
|
||||
"blur",
|
||||
"Boat-Item-View",
|
||||
"bobby",
|
||||
"cat_jam",
|
||||
"chat_heads",
|
||||
"chatanimation",
|
||||
"cherishedworlds",
|
||||
"citresewn",
|
||||
"clickadv",
|
||||
"connector",
|
||||
"DisableCustomWorldsAdvice",
|
||||
"drippyloadingscreen",
|
||||
"eating-animation",
|
||||
"emiffect",
|
||||
"emitrades",
|
||||
"entity_model_features",
|
||||
"entity_texture_features",
|
||||
"entityculling",
|
||||
"euphoriapatcher",
|
||||
"fallingleaves",
|
||||
"fancymenu",
|
||||
"fast-ip-ping",
|
||||
"FauxCustomEntityData",
|
||||
"GeckoLibIrisCompat",
|
||||
"gpumemleakfix",
|
||||
"Highlighter",
|
||||
"ImmediatelyFast",
|
||||
"indium",
|
||||
"iris",
|
||||
"iris-flywheel",
|
||||
"ItemBorders",
|
||||
"ItemLocks",
|
||||
"language-reload",
|
||||
"lazy-language-loader",
|
||||
"LegendaryTooltips",
|
||||
"loadmyresources",
|
||||
"lootbeams",
|
||||
"MindfulDarkness",
|
||||
"MouseTweaks",
|
||||
"nicer-skies",
|
||||
"notenoughanimations",
|
||||
"oculus",
|
||||
"OverflowingBars",
|
||||
"PickUpNotifier",
|
||||
"PresenceFootsteps",
|
||||
"Prism",
|
||||
"reeses_sodium_options",
|
||||
"ResourcePackOverrides",
|
||||
"ryoamiclights",
|
||||
"Searchables",
|
||||
"seasonhud",
|
||||
"ShoulderSurfing",
|
||||
"skinlayers3d",
|
||||
"sodium",
|
||||
"sorted_enchantments",
|
||||
"visuality",
|
||||
"VR-Combat",
|
||||
"YeetusExperimentus",
|
||||
"yungsmenutweaks",
|
||||
"Zoomify"
|
||||
],
|
||||
"globalForceIncludes": [],
|
||||
"modpacks": {}
|
||||
}
|
||||
BIN
notes/Hairpin routing.drawio.png
Normal file
BIN
notes/Hairpin routing.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -57,6 +57,9 @@ fi
|
||||
# Setup RCON password
|
||||
|
||||
if isTrue "${ENABLE_RCON:-true}"; then
|
||||
# turn off debug output
|
||||
set +x
|
||||
|
||||
if [[ -v RCON_PASSWORD_FILE ]]; then
|
||||
if [ ! -e "${RCON_PASSWORD_FILE}" ]; then
|
||||
log ""
|
||||
@@ -78,11 +81,12 @@ if isTrue "${ENABLE_RCON:-true}"; then
|
||||
# For rcon-cli access running via exec, which by default is running as root
|
||||
echo "password=${RCON_PASSWORD}" > "$HOME/.rcon-cli.env"
|
||||
echo "password: \"${RCON_PASSWORD}\"" > "$HOME/.rcon-cli.yaml"
|
||||
|
||||
isDebugging && set -x
|
||||
else
|
||||
rm -f "$HOME/.rcon-cli.env" "$HOME/.rcon-cli.yaml"
|
||||
fi
|
||||
|
||||
|
||||
##########################################
|
||||
# Auto-pause/stop
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ set -eu
|
||||
: "${CF_FORCE_SYNCHRONIZE:=false}"
|
||||
: "${CF_FORCE_REINSTALL_MODLOADER:=false}"
|
||||
: "${CF_IGNORE_MISSING_FILES:=}"
|
||||
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
|
||||
: "${CF_EXCLUDE_INCLUDE_FILE=/image/cf-exclude-include.json}"
|
||||
: "${CF_EXCLUDE_MODS:=}"
|
||||
: "${CF_FORCE_INCLUDE_MODS:=}"
|
||||
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
||||
|
||||
@@ -9,10 +9,11 @@ resultsFile=/data/.install-modrinth.env
|
||||
: "${MODRINTH_MODPACK:=${MODRINTH_PROJECT:-}}"
|
||||
: "${MODRINTH_LOADER:=}"
|
||||
: "${MODRINTH_VERSION:=${MODRINTH_VERSION_ID:-}}"
|
||||
: "${MODRINTH_IGNORE_MISSING_FILES:=}"
|
||||
: "${MODRINTH_EXCLUDE_FILES:=}"
|
||||
: "${MODRINTH_FORCE_INCLUDE_FILES:=}"
|
||||
: "${MODRINTH_OVERRIDES_EXCLUSIONS:=}"
|
||||
: "${MODRINTH_IGNORE_MISSING_FILES=}"
|
||||
: "${MODRINTH_EXCLUDE_FILES=}"
|
||||
: "${MODRINTH_FORCE_INCLUDE_FILES=}"
|
||||
: "${MODRINTH_OVERRIDES_EXCLUSIONS=}"
|
||||
: "${MODRINTH_DEFAULT_EXCLUDE_INCLUDES=/image/modrinth-exclude-include.json}"
|
||||
|
||||
if [[ ! $MODRINTH_MODPACK ]]; then
|
||||
log "ERROR: MODRINTH_MODPACK must be set when using TYPE/MOD_PLATFORM of MODRINTH"
|
||||
@@ -60,6 +61,7 @@ setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
|
||||
setArg --exclude-files MODRINTH_EXCLUDE_FILES
|
||||
setArg --force-include-files MODRINTH_FORCE_INCLUDE_FILES
|
||||
setArg --overrides-exclusions MODRINTH_OVERRIDES_EXCLUSIONS
|
||||
setArg --default-exclude-includes MODRINTH_DEFAULT_EXCLUDE_INCLUDES
|
||||
|
||||
if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
|
||||
log "ERROR failed to install Modrinth modpack"
|
||||
|
||||
@@ -6,9 +6,11 @@ set -o pipefail
|
||||
handleDebugMode
|
||||
|
||||
: "${PAPER_PROJECT:=paper}"
|
||||
: "${PAPERBUILD:=}"
|
||||
: "${PAPER_BUILD:=${PAPERBUILD:-}}"
|
||||
: "${PAPER_CHANNEL:=default}"
|
||||
: "${PAPER_DOWNLOAD_URL:=}"
|
||||
: "${PAPER_CUSTOM_JAR:=}"
|
||||
: "${PAPER_CONFIG_DEFAULTS_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}"
|
||||
|
||||
resultsFile=/data/.paper.env
|
||||
if [[ $PAPER_CUSTOM_JAR ]]; then
|
||||
@@ -33,9 +35,10 @@ else
|
||||
--results-file="$resultsFile"
|
||||
--project="$PAPER_PROJECT"
|
||||
--version="$VERSION"
|
||||
--channel="$PAPER_CHANNEL"
|
||||
)
|
||||
if [[ $PAPERBUILD ]]; then
|
||||
args+=(--build="$PAPERBUILD")
|
||||
if [[ $PAPER_BUILD ]]; then
|
||||
args+=(--build="$PAPER_BUILD")
|
||||
fi
|
||||
if ! mc-image-helper install-paper "${args[@]}"; then
|
||||
log "ERROR: failed to download $PAPER_PROJECT"
|
||||
|
||||
@@ -227,6 +227,12 @@ MC_HEALTH_EXTRA_ARGS=(
|
||||
--use-server-list-ping
|
||||
)
|
||||
" > /data/.mc-health.env
|
||||
elif isTrue "$USES_PROXY_PROTOCOL"; then
|
||||
echo "
|
||||
MC_HEALTH_EXTRA_ARGS=(
|
||||
--use-proxy
|
||||
)
|
||||
" > /data/.mc-health.env
|
||||
else
|
||||
rm -f /data/.mc-health.env
|
||||
fi
|
||||
|
||||
@@ -5,10 +5,15 @@
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
if [ "$TYPE" = "CURSEFORGE" ]; then
|
||||
worldDest=$FTB_DIR/${LEVEL:-world}
|
||||
# support absolute directories
|
||||
if [[ "${LEVEL:-world}" =~ ^\/.*$ ]]; then
|
||||
worldDest=${LEVEL}
|
||||
else
|
||||
worldDest=/data/${LEVEL:-world}
|
||||
if [ "$TYPE" = "CURSEFORGE" ]; then
|
||||
worldDest=$FTB_DIR/${LEVEL:-world}
|
||||
else
|
||||
worldDest=/data/${LEVEL:-world}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
||||
|
||||
@@ -8,7 +8,10 @@ handleDebugMode
|
||||
|
||||
: "${SPIGET_RESOURCES:=}"
|
||||
: "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes
|
||||
: "${REMOVE_OLD_MODS:=false}"
|
||||
: "${REMOVE_OLD_MODS_EXCLUDE:=}"
|
||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
||||
: "${REMOVE_OLD_MODS_DEPTH:=1} "
|
||||
|
||||
acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)
|
||||
|
||||
@@ -127,7 +130,7 @@ downloadResourceFromSpiget() {
|
||||
}
|
||||
|
||||
if [[ ${SPIGET_RESOURCES} ]]; then
|
||||
if isTrue "${REMOVE_OLD_MODS:-false}"; then
|
||||
if isTrue "${REMOVE_OLD_MODS}"; then
|
||||
removeOldMods /data/plugins
|
||||
REMOVE_OLD_MODS=false
|
||||
fi
|
||||
|
||||
@@ -64,7 +64,7 @@ function getFilenameFromUrl() {
|
||||
|
||||
function isTrue() {
|
||||
case "${1,,}" in
|
||||
true | on | 1)
|
||||
true | yes | on | 1)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
@@ -75,7 +75,7 @@ function isTrue() {
|
||||
|
||||
function isFalse() {
|
||||
case "${1,,}" in
|
||||
false | off | 0)
|
||||
false | no | off | 0)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
@@ -161,9 +161,112 @@ function normalizeMemSize() {
|
||||
echo $((val * scale))
|
||||
}
|
||||
|
||||
function compare_version() {
|
||||
local left_version=$1
|
||||
local comparison=$2
|
||||
local right_version=$3
|
||||
|
||||
if [[ -z "$left_version" ]]; then
|
||||
echo "Left version is required"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z "$right_version" ]]; then
|
||||
echo "Right version is required"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Handle version channels ('a', 'b', or numeric)
|
||||
if [[ $left_version == a* || $left_version == b* ]]; then
|
||||
left_version=${left_version:1}
|
||||
fi
|
||||
|
||||
if [[ $right_version == a* || $right_version == b* ]]; then
|
||||
right_version=${right_version:1}
|
||||
fi
|
||||
|
||||
|
||||
local left_version_channel=${left_version:0:1}
|
||||
if [[ $left_version_channel =~ [0-9] ]]; then
|
||||
left_version_channel='r'
|
||||
fi
|
||||
|
||||
local right_version_channel=${right_version:0:1}
|
||||
if [[ $right_version_channel =~ [0-9] ]]; then
|
||||
right_version_channel='r'
|
||||
fi
|
||||
|
||||
if [[ $comparison == "lt" && $left_version_channel < $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "lt" && $left_version_channel > $right_version_channel ]]; then
|
||||
return 1
|
||||
elif [[ $comparison == "gt" && $left_version_channel > $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "gt" && $left_version_channel < $right_version_channel ]]; then
|
||||
return 1
|
||||
elif [[ $comparison == "le" && $left_version_channel < $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "le" && $left_version_channel == $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "ge" && $left_version_channel > $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "ge" && $left_version_channel == $right_version_channel ]]; then
|
||||
return 0
|
||||
elif [[ $comparison == "eq" && $left_version_channel == $right_version_channel ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Compare the versions using sort -V
|
||||
local result
|
||||
|
||||
case $comparison in
|
||||
"lt")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
"le")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" ]]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
"eq")
|
||||
if [[ "$left_version" == "$right_version" ]]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
"ge")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" ]]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
"gt")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported comparison operator: $comparison"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
function versionLessThan() {
|
||||
# Use if-else since strict mode might be enabled
|
||||
if mc-image-helper compare-versions "${VERSION}" lt "${1?}"; then
|
||||
if compare_version "${VERSION}" "lt" "${1?}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@@ -207,13 +310,13 @@ eula=${EULA,,}
|
||||
|
||||
function removeOldMods {
|
||||
if [ -d "$1" ]; then
|
||||
log "Removing old mods including:${REMOVE_OLD_MODS_INCLUDE} excluding:${REMOVE_OLD_MODS_EXCLUDE}"
|
||||
log "Removing old mods including='${REMOVE_OLD_MODS_INCLUDE}' excluding='${REMOVE_OLD_MODS_EXCLUDE}' up to depth=${REMOVE_OLD_MODS_DEPTH}"
|
||||
args=(
|
||||
--delete
|
||||
--type file
|
||||
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}"
|
||||
--name "${REMOVE_OLD_MODS_INCLUDE:-*}"
|
||||
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}"
|
||||
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH}"
|
||||
--name "${REMOVE_OLD_MODS_INCLUDE}"
|
||||
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE}"
|
||||
)
|
||||
if ! isDebugging; then
|
||||
args+=(--quiet)
|
||||
@@ -342,7 +445,7 @@ function ensureRemoveAllModsOff() {
|
||||
reason=${1?}
|
||||
|
||||
if isTrue "${REMOVE_OLD_MODS:-false}"; then
|
||||
log "WARNING using REMOVE_OLDS_MODS interferes with $reason -- it is now disabled"
|
||||
log "WARNING using REMOVE_OLD_MODS interferes with $reason -- it is now disabled"
|
||||
REMOVE_OLD_MODS=false
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
: "${IMAGE_TO_TEST:=itzg/minecraft-server}"
|
||||
|
||||
# go to script root directory
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
|
||||
@@ -46,7 +48,7 @@ setupOnlyMinecraftTest(){
|
||||
outputContainerLog "$logs"
|
||||
result=1
|
||||
elif [ -f verify.sh ]; then
|
||||
if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST:-itzg/minecraft-server}" -e /verify; then
|
||||
if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST}" -e /verify; then
|
||||
endTime=$(date +%s)
|
||||
echo "${folder} FAILED verify in $(delta start)"
|
||||
outputContainerLog "$logs"
|
||||
@@ -74,7 +76,7 @@ if (( $# > 0 )); then
|
||||
else
|
||||
readarray -t folders < <(find . -maxdepth 2 -mindepth 2 -name docker-compose.yml -printf '%h\n')
|
||||
for folder in "${folders[@]}"; do
|
||||
echo "Starting Tests in ${folder}"
|
||||
echo "Starting Tests in ${folder} using $IMAGE_TO_TEST"
|
||||
setupOnlyMinecraftTest "$folder"
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user