mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 15:36:22 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9140fb84a | ||
|
|
07708209a6 | ||
|
|
fd20fc9654 | ||
|
|
4085d28773 | ||
|
|
7dbeac99d3 | ||
|
|
e4773e47cb | ||
|
|
da4f7d0dd8 | ||
|
|
afbdfea0bb | ||
|
|
f5da624789 | ||
|
|
fdc1f446af | ||
|
|
1b8b694036 | ||
|
|
7974baca7e | ||
|
|
d4af9b1ae5 | ||
|
|
34187adca3 | ||
|
|
d0a3ee3b64 | ||
|
|
6683c91b74 | ||
|
|
a0e274a7b7 | ||
|
|
5d8a152db2 | ||
|
|
df8f8f1716 | ||
|
|
295996b033 | ||
|
|
5ac7b1d108 | ||
|
|
f420b92d05 | ||
|
|
96019b02ee | ||
|
|
c271ad99e0 | ||
|
|
222b522bc1 |
13
.github/workflows/build-multiarch.yml
vendored
13
.github/workflows/build-multiarch.yml
vendored
@@ -31,7 +31,6 @@ jobs:
|
||||
- java8-graalvm-ce
|
||||
- java8-openj9
|
||||
- java8-jdk
|
||||
- java8-alpine
|
||||
- java11
|
||||
include:
|
||||
# JAVA 21:
|
||||
@@ -75,10 +74,6 @@ jobs:
|
||||
baseImage: eclipse-temurin:8u312-b07-jre-focal
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.12.2
|
||||
- variant: java8-alpine
|
||||
baseImage: openjdk:8-jre-alpine3.9
|
||||
platforms: linux/amd64
|
||||
mcVersion: 1.12.2
|
||||
- variant: java8-graalvm-ce
|
||||
baseImage: ghcr.io/graalvm/graalvm-ce:java8
|
||||
platforms: linux/amd64
|
||||
@@ -98,7 +93,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.7
|
||||
uses: actions/checkout@v4.2.1
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
@@ -133,13 +128,13 @@ jobs:
|
||||
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.6.1
|
||||
uses: docker/setup-buildx-action@v3.7.1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.2.0
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v6.7.0
|
||||
uses: docker/build-push-action@v6.9.0
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
@@ -177,7 +172,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6.7.0
|
||||
uses: docker/build-push-action@v6.9.0
|
||||
if: github.actor == github.repository_owner
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
|
||||
2
.github/workflows/discord.yml
vendored
2
.github/workflows/discord.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
steps:
|
||||
- name: on-publish
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
uses: SethCohen/github-releases-to-discord@v1.15.0
|
||||
uses: SethCohen/github-releases-to-discord@v1.15.1
|
||||
with:
|
||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
- name: on-success
|
||||
|
||||
8
.github/workflows/verify-pr.yml
vendored
8
.github/workflows/verify-pr.yml
vendored
@@ -47,16 +47,16 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.7
|
||||
uses: actions/checkout@v4.2.1
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.6.1
|
||||
uses: docker/setup-buildx-action@v3.7.1
|
||||
|
||||
- name: Confirm multi-arch build
|
||||
uses: docker/build-push-action@v6.7.0
|
||||
uses: docker/build-push-action@v6.9.0
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
# ensure latest base image is used
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v6.7.0
|
||||
uses: docker/build-push-action@v6.9.0
|
||||
with:
|
||||
# Only build single platform since loading multi-arch image into daemon fails with
|
||||
# "docker exporter does not currently support exporting manifest lists"
|
||||
|
||||
21
Dockerfile
21
Dockerfile
@@ -7,9 +7,14 @@ ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
# The following three arg/env vars get used by the platform specific "install-packages" script
|
||||
ARG EXTRA_DEB_PACKAGES=""
|
||||
ARG EXTRA_DNF_PACKAGES=""
|
||||
ARG EXTRA_ALPINE_PACKAGES=""
|
||||
ARG FORCE_INSTALL_PACKAGES=1
|
||||
RUN --mount=target=/build,source=build \
|
||||
TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
||||
TARGET=${TARGETARCH}${TARGETVARIANT} \
|
||||
/build/run.sh install-packages
|
||||
|
||||
RUN --mount=target=/build,source=build \
|
||||
/build/run.sh setup-user
|
||||
@@ -21,31 +26,31 @@ EXPOSE 25565
|
||||
ARG APPS_REV=1
|
||||
ARG GITHUB_BASEURL=https://github.com
|
||||
|
||||
ARG EASY_ADD_VERSION=0.8.7
|
||||
ARG EASY_ADD_VERSION=0.8.8
|
||||
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.4
|
||||
ARG RESTIFY_VERSION=1.7.5
|
||||
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.8
|
||||
ARG RCON_CLI_VERSION=1.6.9
|
||||
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.13
|
||||
ARG MC_MONITOR_VERSION=0.14.1
|
||||
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.2
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.12.3
|
||||
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.39.11
|
||||
ARG MC_HELPER_VERSION=1.40.2
|
||||
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
|
||||
@@ -72,4 +77,4 @@ RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPa
|
||||
RUN dos2unix /start* /auto/*
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=30s --retries=24 --interval=60s CMD mc-health
|
||||
HEALTHCHECK --start-period=2m --retries=2 --interval=30s CMD mc-health
|
||||
|
||||
@@ -17,7 +17,7 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
if [ "$(id -u)" = 0 -a $UID != 0 ]; then
|
||||
if [[ $(getDistro) == alpine ]]; then
|
||||
exec su-exec minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
|
||||
else
|
||||
|
||||
@@ -4,6 +4,7 @@ set -e
|
||||
set -o pipefail
|
||||
|
||||
# Install necessary packages
|
||||
# shellcheck disable=SC2086
|
||||
apk add --no-cache -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
@@ -29,7 +30,8 @@ apk add --no-cache -U \
|
||||
nfs-utils \
|
||||
libpcap \
|
||||
libwebp \
|
||||
libcap
|
||||
libcap \
|
||||
${EXTRA_ALPINE_PACKAGES}
|
||||
|
||||
# Download and install patched knockd
|
||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
|
||||
|
||||
@@ -23,6 +23,7 @@ EOF
|
||||
dnf update -y
|
||||
|
||||
# Install necessary packages
|
||||
# shellcheck disable=SC2086
|
||||
dnf install -y \
|
||||
ImageMagick \
|
||||
file \
|
||||
@@ -44,7 +45,8 @@ dnf install -y \
|
||||
libpcap \
|
||||
libwebp \
|
||||
findutils \
|
||||
which
|
||||
which \
|
||||
${EXTRA_DNF_PACKAGES}
|
||||
|
||||
# Install Git LFS
|
||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
|
||||
|
||||
@@ -6,6 +6,7 @@ set -euo pipefail
|
||||
|
||||
# Update and install packages
|
||||
apt-get update
|
||||
# shellcheck disable=SC2086
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
@@ -26,7 +27,8 @@ apt-get install -y \
|
||||
zstd \
|
||||
lbzip2 \
|
||||
nfs-common \
|
||||
libpcap0.8
|
||||
libpcap0.8 \
|
||||
${EXTRA_DEB_PACKAGES}
|
||||
|
||||
# Install Git LFS
|
||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
||||
|
||||
@@ -26,3 +26,11 @@ or just a plain build
|
||||
```shell
|
||||
docker build -t IMG_PREFIX/minecraft-server .
|
||||
```
|
||||
|
||||
## Installing extra packages
|
||||
|
||||
The following build args can be set to install additional packages for the respective base image distro:
|
||||
|
||||
- `EXTRA_DEB_PACKAGES`
|
||||
- `EXTRA_DNF_PACKAGES`
|
||||
- `EXTRA_ALPINE_PACKAGES`
|
||||
|
||||
@@ -3,3 +3,5 @@ To troubleshoot the container initialization, such as when server files are pre-
|
||||
To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`.
|
||||
|
||||
To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`.
|
||||
|
||||
If you are experiencing any issues with the "Changing ownership of /data" step, that can be disabled by setting `SKIP_CHOWN_DATA` to `true`.
|
||||
|
||||
@@ -9,16 +9,18 @@
|
||||
|
|
||||
+-- project slug
|
||||
```
|
||||
Also, a specific version/type can be declared using colon symbol and version id/type after the project slug. The version id can be found in the 'Metadata' section. Valid version types are `release`, `beta`, `alpha`.
|
||||
|
||||
!!! example
|
||||
Also, a specific version (or release type) can be declared adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
|
||||
|
||||
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
|
||||
|
||||
| Description | Example |
|
||||
|---------------------------------|-----------------------|
|
||||
| Select latest version | `fabric-api` |
|
||||
| Select specific version | `fabric-api:PbVeub96` |
|
||||
| Select latest beta version | `fabric-api:beta` |
|
||||
| Latest version using project ID | `P7dR8mSH` |
|
||||
| Description | Example projects entry |
|
||||
|---------------------------------|----------------------------|
|
||||
| Select latest version | `fabric-api` |
|
||||
| Select specific version | `fabric-api:PbVeub96` |
|
||||
| Select latest beta version | `fabric-api:beta` |
|
||||
| Latest version using project ID | `P7dR8mSH` |
|
||||
| Latest version of datapack | `datapack:terralith` |
|
||||
| Specific version of datapack | `datapack:terralith:2.5.5` |
|
||||
|
||||
## Extra options
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mkdocs-material == 9.5.34
|
||||
mkdocs-material == 9.5.40
|
||||
mkdocs-autorefs == 1.2.0
|
||||
mkdocstrings == 0.26.0
|
||||
mkdocstrings == 0.26.2
|
||||
mkdocs-literate-nav == 0.6.1
|
||||
mdx-gh-links == 0.4
|
||||
mkdocs-click == 0.8.1
|
||||
|
||||
@@ -164,6 +164,11 @@ Quite often there are mods that need to be excluded, such as ones that did not p
|
||||
|
||||
Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
|
||||
|
||||
!!! note
|
||||
`CF_FORCE_INCLUDE_MODS` will not download additional mods.
|
||||
|
||||
For additional mods, refer to [the `CURSEFORGE_FILES` variable](../../mods-and-plugins/curseforge-files.md).
|
||||
|
||||
A mod's project ID can be obtained from the right hand side of the project page:
|
||||

|
||||
|
||||
|
||||
@@ -563,35 +563,35 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_STARTUP</code></td>
|
||||
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_ON_CONNECT</code></td>
|
||||
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_ON_DISCONNECT</code></td>
|
||||
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_LAST_DISCONNECT</code></td>
|
||||
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_STARTUP</code></td>
|
||||
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<td><code>RCON_CMDS_STARTUP</code></td>
|
||||
<td>RCON commands to execute when the server starts.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_ON_CONNECT</code></td>
|
||||
<td>RCON commands to execute whenever a client connects to the server.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_FIRST_CONNECT</code></td>
|
||||
<td>RCON commands to execute on the first client connection to the server.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_ON_DISCONNECT</code></td>
|
||||
<td>RCON commands to execute whenever a client disconnects from the server.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>RCON_CMDS_LAST_DISCONNECT</code></td>
|
||||
<td>RCON commands to execute when the last client disconnects from the server.</td>
|
||||
<td><code></code></td>
|
||||
<td>⬜️</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ where `<tag>` refers to the first column of this table:
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) |
|
||||
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 |
|
||||
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 |
|
||||
| java8-alpine | 8 | Alpine | Hotspot | amd64 (1) |
|
||||
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
|
||||
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
||||
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
|
||||
@@ -133,5 +132,6 @@ The following image tags have been deprecated and are no longer receiving update
|
||||
- java17-openj9
|
||||
- java20-graalvm, java20, java20-alpine
|
||||
- java8-multiarch is still built and pushed, but please move to java8 instead
|
||||
- java8-alpine
|
||||
|
||||
[^1]: Based on the [Oracle GraalMV images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise.
|
||||
@@ -1,19 +1,20 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:java17
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: true
|
||||
TYPE: MODRINTH
|
||||
MEMORY: 4G
|
||||
MODRINTH_MODPACK: better-mc-forge-bmc4
|
||||
MODRINTH_VERSION: v28
|
||||
MOD_PLATFORM: MODRINTH
|
||||
MODRINTH_MODPACK: https://modrinth.com/modpack/better-mc-forge-bmc4/version/v32.5
|
||||
MODRINTH_EXCLUDE_FILES: |
|
||||
XaeroPlus
|
||||
XaerosWorldMap
|
||||
MODRINTH_OVERRIDES_EXCLUSIONS: |
|
||||
mods/NekosEnchantedBooks-*.jar
|
||||
mods/citresewn-*.jar
|
||||
volumes:
|
||||
- data:/data
|
||||
**/datapacks/BE_default_endgen_fix*
|
||||
MODRINTH_FORCE_SYNCHRONIZE: true
|
||||
MEMORY: 4G
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
# declare /data volume mapping as desired
|
||||
# volumes:
|
||||
# - ./data:/data
|
||||
60
examples/optimized-paper-config/README.md
Normal file
60
examples/optimized-paper-config/README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# A Form to Load New Config Files to Paper MC
|
||||
|
||||
In this example, we illustrate how to efficiently load and manage different configuration files to optimize a Paper Minecraft server. To implement this, it is necessary to create a dedicated repository where the configuration files can be stored and later retrieved. The repository should adhere to a specific structure to facilitate seamless integration with your Docker setup. Notably, the configurations must be organized into a folder named after the version of Minecraft you are using.
|
||||
|
||||
For reference, I have provided this [repository](https://github.com/Alpha018/paper-config-optimized), which contains optimized configuration files for the latest version of Minecraft. You can use this repository by linking directly to the configuration files in your Docker file, as demonstrated in the example below.
|
||||
|
||||
## Usage
|
||||
|
||||
You can directly use the optimized configuration files from this repository by accessing them through the GitHub raw URLs. Simply replace the env var like the docker compose with any other repo with different configurations.
|
||||
|
||||
To use the raw files, you can download or link to them using the following pattern:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "PAPER"
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/[your-username]/[your-repository]/main/[file-path]"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper: {}
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "PAPER"
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper: {}
|
||||
```
|
||||
|
||||
Feel free to explore and use the configurations in this repo to enhance your Minecraft server's performance.
|
||||
|
||||
## Contribution
|
||||
|
||||
If you'd like to improve or suggest changes to these configurations, feel free to submit a pull request in this [repository](https://github.com/Alpha018/paper-config-optimized). We welcome contributions from the community!
|
||||
|
||||
17
examples/optimized-paper-config/docker-compose.yml
Normal file
17
examples/optimized-paper-config/docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: "PAPER"
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main"
|
||||
ports:
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper: {}
|
||||
@@ -6,6 +6,7 @@
|
||||
# The Dockerfile ENVs take precedence here, but defaulting for testing consistency
|
||||
: "${UID:=1000}"
|
||||
: "${GID:=1000}"
|
||||
: "${SKIP_CHOWN_DATA:=false}"
|
||||
|
||||
umask "${UMASK:=0002}"
|
||||
|
||||
@@ -38,7 +39,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(stat -c "%u" /data) != "$UID" ]]; then
|
||||
if isTrue "${SKIP_CHOWN_DATA}" || [[ $(stat -c "%u" /data) != "$UID" ]]; then
|
||||
log "Changing ownership of /data to $UID ..."
|
||||
chown -R ${runAsUser}:${runAsGroup} /data
|
||||
fi
|
||||
|
||||
@@ -20,6 +20,7 @@ set -eu
|
||||
: "${CF_OVERRIDES_EXCLUSIONS:=}" # --overrides-exclusions
|
||||
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
|
||||
: "${CF_MODPACK_MANIFEST:=}"
|
||||
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
|
||||
|
||||
resultsFile=/data/.install-curseforge.env
|
||||
|
||||
@@ -29,49 +30,31 @@ ensureRemoveAllModsOff "MOD_PLATFORM=AUTO_CURSEFORGE"
|
||||
|
||||
args=(
|
||||
--results-file="$resultsFile"
|
||||
)
|
||||
if [[ $CF_PAGE_URL ]]; then
|
||||
args+=(--modpack-page-url="$CF_PAGE_URL")
|
||||
fi
|
||||
if [[ $CF_FILE_ID ]]; then
|
||||
args+=(--file-id="$CF_FILE_ID")
|
||||
fi
|
||||
if [[ $CF_SLUG ]]; then
|
||||
args+=(--slug="$CF_SLUG")
|
||||
fi
|
||||
if [[ $CF_MODPACK_MANIFEST ]]; then
|
||||
args+=(--modpack-manifest="$CF_MODPACK_MANIFEST")
|
||||
fi
|
||||
if [[ $CF_FILENAME_MATCHER ]]; then
|
||||
args+=(--filename-matcher="$CF_FILENAME_MATCHER")
|
||||
fi
|
||||
if [[ ${CF_SET_LEVEL_FROM} ]]; then
|
||||
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
|
||||
fi
|
||||
if [[ ${CF_OVERRIDES_EXCLUSIONS} ]]; then
|
||||
args+=(--overrides-exclusions="$CF_OVERRIDES_EXCLUSIONS")
|
||||
fi
|
||||
if [[ ${CF_IGNORE_MISSING_FILES} ]]; then
|
||||
args+=(--ignore-missing-files="$CF_IGNORE_MISSING_FILES")
|
||||
fi
|
||||
args+=(
|
||||
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
|
||||
--force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"
|
||||
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
||||
)
|
||||
setArg() {
|
||||
arg="${1?}"
|
||||
var="${2?}"
|
||||
|
||||
if [[ $CF_EXCLUDE_MODS ]]; then
|
||||
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
|
||||
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
|
||||
fi
|
||||
if [[ $CF_DOWNLOADS_REPO ]]; then
|
||||
args+=( --downloads-repo="$CF_DOWNLOADS_REPO" )
|
||||
fi
|
||||
if [[ ${!var} ]]; then
|
||||
args+=("${arg}=${!var}")
|
||||
fi
|
||||
}
|
||||
setArg --modpack-page-url CF_PAGE_URL
|
||||
setArg --file-id CF_FILE_ID
|
||||
setArg --slug CF_SLUG
|
||||
setArg --modpack-manifest CF_MODPACK_MANIFEST
|
||||
setArg --filename-matcher CF_FILENAME_MATCHER
|
||||
setArg --set-level-from CF_SET_LEVEL_FROM
|
||||
setArg --overrides-exclusions CF_OVERRIDES_EXCLUSIONS
|
||||
setArg --ignore-missing-files CF_IGNORE_MISSING_FILES
|
||||
setArg --api-cache-default-ttl CF_API_CACHE_DEFAULT_TTL
|
||||
setArg --exclude-mods CF_EXCLUDE_MODS
|
||||
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
|
||||
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
|
||||
setArg --downloads-repo CF_DOWNLOADS_REPO
|
||||
|
||||
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
||||
log "ERROR failed to auto-install CurseForge modpack"
|
||||
|
||||
@@ -88,6 +88,32 @@ if ! [ -v SERVER ]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export FAMILY=FORGE
|
||||
# Remap the TYPE and FAMILY based on discovered server jar
|
||||
if [[ $SERVER = run.sh ]]; then
|
||||
if grep -q neoforge "$SERVER"; then
|
||||
export FAMILY=FORGE
|
||||
export TYPE=NEOFORGE
|
||||
elif grep -q forge "$SERVER"; then
|
||||
export FAMILY=FORGE
|
||||
export TYPE=FORGE
|
||||
elif grep -q fabric run.s; then
|
||||
export FAMILY=FABRIC
|
||||
export TYPE=FABRIC
|
||||
else
|
||||
log "ERROR: unrecognized loader type in $SERVER"
|
||||
cat "$SERVER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
elif [[ $SERVER = forge* ]]; then
|
||||
export FAMILY=FORGE
|
||||
export TYPE=FORGE
|
||||
elif [[ $SERVER = fabric* ]]; then
|
||||
export FAMILY=FABRIC
|
||||
export TYPE=FABRIC
|
||||
else
|
||||
log "ERROR: unrecognized loader type from $SERVER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
||||
@@ -10,7 +10,7 @@ handleDebugMode
|
||||
: "${PAPER_CHANNEL:=default}"
|
||||
: "${PAPER_DOWNLOAD_URL:=}"
|
||||
: "${PAPER_CUSTOM_JAR:=}"
|
||||
: "${PAPER_CONFIG_DEFAULTS_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}"
|
||||
: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}}"
|
||||
|
||||
resultsFile=/data/.paper.env
|
||||
if [[ $PAPER_CUSTOM_JAR ]]; then
|
||||
|
||||
@@ -244,14 +244,17 @@ function handleModrinthProjects() {
|
||||
log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead"
|
||||
fi
|
||||
|
||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
||||
if [[ $MODRINTH_PROJECTS ]]; then
|
||||
if isFamily HYBRID; then
|
||||
loader=forge
|
||||
elif isFamily VANILLA; then
|
||||
loader=datapack
|
||||
else
|
||||
loader="${TYPE,,}"
|
||||
fi
|
||||
mc-image-helper modrinth \
|
||||
--output-directory=/data \
|
||||
--world-directory="${LEVEL:-world}" \
|
||||
--projects="${MODRINTH_PROJECTS}" \
|
||||
--game-version="${VERSION}" \
|
||||
--loader="$loader" \
|
||||
|
||||
@@ -34,18 +34,14 @@ function get_major_version() {
|
||||
function isURL() {
|
||||
local value=$1
|
||||
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
[[ $value =~ ^(https?|ftp):// ]]
|
||||
}
|
||||
|
||||
function isValidFileURL() {
|
||||
suffix=${1:?Missing required suffix arg}
|
||||
url=${2:?Missing required url arg}
|
||||
|
||||
[[ "$url" == http*://*.${suffix} || "$url" == http*://*.${suffix}\?* ]]
|
||||
[[ "$url" =~ ^http.*://.*\.${suffix}(\?.*)?$ ]]
|
||||
}
|
||||
|
||||
function resolveEffectiveUrl() {
|
||||
@@ -85,11 +81,7 @@ function isFalse() {
|
||||
}
|
||||
|
||||
function isDebugging() {
|
||||
if isTrue "${DEBUG:-false}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
isTrue "${DEBUG:-false}"
|
||||
}
|
||||
|
||||
function handleDebugMode() {
|
||||
@@ -113,11 +105,9 @@ function log() {
|
||||
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
|
||||
oldState=$(shopt -po xtrace || true)
|
||||
shopt -u -o xtrace
|
||||
|
||||
ts=
|
||||
if isDebugging || isTrue "${LOG_TIMESTAMP:-false}"; then
|
||||
ts=" $(date --rfc-3339=seconds)"
|
||||
else
|
||||
ts=
|
||||
fi
|
||||
echo "[init]${ts} $*"
|
||||
eval "$oldState"
|
||||
@@ -162,106 +152,95 @@ function normalizeMemSize() {
|
||||
}
|
||||
|
||||
function compare_version() {
|
||||
local left_version=$1
|
||||
local comparison=$2
|
||||
local right_version=$3
|
||||
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 "$left_version" ]]; then
|
||||
echo "Left version is required"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z "$right_version" ]]; then
|
||||
echo "Right 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
|
||||
# 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 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
|
||||
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
|
||||
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
|
||||
# Compare the versions using sort -V
|
||||
local result=1
|
||||
|
||||
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
|
||||
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
|
||||
fi
|
||||
;;
|
||||
"le")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" ]]; then
|
||||
result=0
|
||||
fi
|
||||
;;
|
||||
"eq")
|
||||
if [[ "$left_version" == "$right_version" ]]; then
|
||||
result=0
|
||||
fi
|
||||
;;
|
||||
"ge")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" ]]; then
|
||||
result=0
|
||||
fi
|
||||
;;
|
||||
"gt")
|
||||
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
|
||||
result=0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported comparison operator: $comparison"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
return $result
|
||||
return $result
|
||||
}
|
||||
|
||||
function versionLessThan() {
|
||||
@@ -270,14 +249,10 @@ function versionLessThan() {
|
||||
oldState=$(shopt -po xtrace || true)
|
||||
shopt -u -o xtrace
|
||||
|
||||
# Use if-else since strict mode might be enabled
|
||||
if compare_version "${VERSION}" "lt" "${1?}"; then
|
||||
eval "$oldState"
|
||||
return 0
|
||||
else
|
||||
eval "$oldState"
|
||||
return 1
|
||||
fi
|
||||
eval "$oldState"
|
||||
|
||||
# Verify strict mode because it might be enabled
|
||||
compare_version "${VERSION}" "lt" "${1?}"
|
||||
}
|
||||
|
||||
requireVar() {
|
||||
@@ -302,7 +277,7 @@ requireEnum() {
|
||||
done
|
||||
|
||||
log "ERROR: $var must be set to one of $*"
|
||||
# exit 1
|
||||
# exit 1
|
||||
}
|
||||
|
||||
function writeEula() {
|
||||
@@ -369,19 +344,19 @@ function extract() {
|
||||
|
||||
type=$(file -b --mime-type "${src}")
|
||||
case "${type}" in
|
||||
application/zip)
|
||||
unzip -o -q -d "${destDir}" "${src}"
|
||||
;;
|
||||
application/x-tar|application/gzip|application/x-gzip|application/x-bzip2)
|
||||
tar -C "${destDir}" -xf "${src}"
|
||||
;;
|
||||
application/zstd|application/x-zstd)
|
||||
tar -C "${destDir}" --use-compress-program=unzstd -xf "${src}"
|
||||
;;
|
||||
*)
|
||||
log "ERROR: unsupported archive type: $type"
|
||||
return 1
|
||||
;;
|
||||
application/zip)
|
||||
unzip -o -q -d "${destDir}" "${src}"
|
||||
;;
|
||||
application/x-tar | application/gzip | application/x-gzip | application/x-bzip2)
|
||||
tar -C "${destDir}" -xf "${src}"
|
||||
;;
|
||||
application/zstd | application/x-zstd)
|
||||
tar -C "${destDir}" --use-compress-program=unzstd -xf "${src}"
|
||||
;;
|
||||
*)
|
||||
log "ERROR: unsupported archive type: $type"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -395,31 +370,33 @@ function checkSum() {
|
||||
# Get distro
|
||||
distro=$(getDistro)
|
||||
|
||||
if [ "${distro}" == "debian" ] && sha1sum -c "${sum_file}" --status 2> /dev/null; then
|
||||
return 0
|
||||
elif [ "${distro}" == "ubuntu" ] && sha1sum -c "${sum_file}" --status 2> /dev/null; then
|
||||
return 0
|
||||
elif [ "${distro}" == "alpine" ] && sha1sum -c "${sum_file}" -s 2> /dev/null; then
|
||||
return 0
|
||||
elif [ "${distro}" == "ol" ] && sha1sum -c "${sum_file}" --status 2> /dev/null; then
|
||||
return 0
|
||||
else
|
||||
case "${distro}" in
|
||||
debian | ubuntu | ol)
|
||||
sha1sum -c "${sum_file}" --status 2>/dev/null && return 0
|
||||
;;
|
||||
alpine)
|
||||
sha1sum -c "${sum_file}" -s 2>/dev/null && return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function usesMods() {
|
||||
case "$FAMILY" in
|
||||
FORGE|FABRIC|HYBRID|SPONGE)
|
||||
return 0
|
||||
FORGE | FABRIC | HYBRID | SPONGE)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
function usesPlugins() {
|
||||
case "$FAMILY" in
|
||||
SPIGOT|HYBRID)
|
||||
return 0
|
||||
SPIGOT | HYBRID)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
@@ -435,15 +412,15 @@ function resolveVersion() {
|
||||
|
||||
function resolveFamily() {
|
||||
case "$TYPE" in
|
||||
PAPER|SPIGOT|BUKKIT|CANYON|PUFFERFISH|PURPUR)
|
||||
FAMILY=SPIGOT
|
||||
;;
|
||||
FORGE)
|
||||
FAMILY=FORGE
|
||||
;;
|
||||
FABRIC|QUILT)
|
||||
FAMILY=FABRIC
|
||||
;;
|
||||
PAPER | SPIGOT | BUKKIT | CANYON | PUFFERFISH | PURPUR)
|
||||
FAMILY=SPIGOT
|
||||
;;
|
||||
FORGE)
|
||||
FAMILY=FORGE
|
||||
;;
|
||||
FABRIC | QUILT)
|
||||
FAMILY=FABRIC
|
||||
;;
|
||||
esac
|
||||
export FAMILY
|
||||
}
|
||||
|
||||
@@ -44,22 +44,20 @@ setupOnlyMinecraftTest(){
|
||||
# false positive since it's used in delta calculations below
|
||||
# shellcheck disable=SC2034
|
||||
start=$(date +%s)
|
||||
status=PASSED
|
||||
verify=
|
||||
if ! logs=$(docker compose run --rm -e SETUP_ONLY=true -e DEBUG="${DEBUG:-false}" mc 2>&1); then
|
||||
outputContainerLog "$logs"
|
||||
result=1
|
||||
elif [ -f verify.sh ]; then
|
||||
verify=" verify"
|
||||
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)"
|
||||
status=FAILED
|
||||
outputContainerLog "$logs"
|
||||
result=1
|
||||
else
|
||||
endTime=$(date +%s)
|
||||
echo "${folder} PASSED verify in $(delta start)"
|
||||
fi
|
||||
else
|
||||
echo "${folder} PASSED in $(delta start)"
|
||||
fi
|
||||
echo "${folder} ${status}${verify} in $(delta start)"
|
||||
|
||||
docker compose down -v --remove-orphans >& /dev/null
|
||||
cd ..
|
||||
@@ -67,16 +65,17 @@ setupOnlyMinecraftTest(){
|
||||
return $result
|
||||
}
|
||||
|
||||
# go through each folder in setuponly and test setups
|
||||
if (( $# > 0 )); then
|
||||
for folder in "$@"; do
|
||||
echo "Starting Tests in ${folder}"
|
||||
setupOnlyMinecraftTest "$folder"
|
||||
done
|
||||
else
|
||||
foldersList=("$@")
|
||||
image=""
|
||||
|
||||
# Go through each folder in setuponly and test setups
|
||||
if (( $# == 0 )); then
|
||||
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} using $IMAGE_TO_TEST"
|
||||
setupOnlyMinecraftTest "$folder"
|
||||
done
|
||||
foldersList=("${folders[@]}")
|
||||
image=" using $IMAGE_TO_TEST"
|
||||
fi
|
||||
|
||||
for folder in "${foldersList[@]}"; do
|
||||
echo "Starting Tests in ${folder}${image}"
|
||||
setupOnlyMinecraftTest "$folder"
|
||||
done
|
||||
Reference in New Issue
Block a user