mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-19 07:46:23 +00:00
Compare commits
157 Commits
2022.2.0
...
2022.3.0-j
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68b926f2b1 | ||
|
|
306671ffe7 | ||
|
|
be99d171f5 | ||
|
|
882f3b1cd8 | ||
|
|
eb6c7c98f0 | ||
|
|
3472c67ca8 | ||
|
|
8995e63b72 | ||
|
|
b65f108917 | ||
|
|
2b374a2073 | ||
|
|
b5b164d5d3 | ||
|
|
0cde40604e | ||
|
|
22f2eb7308 | ||
|
|
4a1d2d2b80 | ||
|
|
10922b261b | ||
|
|
13883b20e7 | ||
|
|
c52c3fb04a | ||
|
|
67c8879c6b | ||
|
|
aca8701072 | ||
|
|
d2452ba18f | ||
|
|
7f940626d8 | ||
|
|
7246d836ec | ||
|
|
c01e97ca94 | ||
|
|
b59eefd556 | ||
|
|
ce6ef7d81c | ||
|
|
0a2e6721fb | ||
|
|
5461107b83 | ||
|
|
5356c76dd6 | ||
|
|
bd97029446 | ||
|
|
6537cfb5b5 | ||
|
|
6729ba462e | ||
|
|
4b28d5e472 | ||
|
|
51002c956e | ||
|
|
de62cf8dc7 | ||
|
|
3f2022da40 | ||
|
|
0f7464403c | ||
|
|
c9d5ad7530 | ||
|
|
1be933bd63 | ||
|
|
99b792dec1 | ||
|
|
ee5267cf41 | ||
|
|
0a46d0382e | ||
|
|
cc61497f7e | ||
|
|
2c2cbadd9a | ||
|
|
bfc29d289d | ||
|
|
84a1313261 | ||
|
|
39bcfddf3c | ||
|
|
e6ea8197aa | ||
|
|
0184c095fc | ||
|
|
524a7e21f3 | ||
|
|
f817cae945 | ||
|
|
675d05920b | ||
|
|
106a7132d4 | ||
|
|
0e04a10efa | ||
|
|
0d8df635d6 | ||
|
|
e0dedc194d | ||
|
|
ef32e8ed4c | ||
|
|
489b583ad7 | ||
|
|
8c4dff22fb | ||
|
|
455f31c9d8 | ||
|
|
bac1bfb5dc | ||
|
|
9994c64b51 | ||
|
|
92079fc01f | ||
|
|
98378130f2 | ||
|
|
42856da49d | ||
|
|
83b05609d3 | ||
|
|
21fab1bf41 | ||
|
|
2849359a11 | ||
|
|
cd337f34da | ||
|
|
7a9aa760a2 | ||
|
|
2fd405ec5b | ||
|
|
cbfe9a069c | ||
|
|
2db61fd72f | ||
|
|
6e2073fda5 | ||
|
|
ae48a8710e | ||
|
|
3b54a9fd67 | ||
|
|
a66efb1a4f | ||
|
|
83938d8989 | ||
|
|
8335b81bd8 | ||
|
|
b9c379ec6c | ||
|
|
b9ecbf7497 | ||
|
|
eca00e88bf | ||
|
|
2a3169344d | ||
|
|
8ec4f0d244 | ||
|
|
d45250ebf2 | ||
|
|
03110aef99 | ||
|
|
f344e7e823 | ||
|
|
c7fcaf1ec6 | ||
|
|
9d700041a7 | ||
|
|
4af4ed69a5 | ||
|
|
d215c14996 | ||
|
|
4716254b5b | ||
|
|
3c2b7f0718 | ||
|
|
0fd43f5a05 | ||
|
|
fae6479453 | ||
|
|
d9df5bf773 | ||
|
|
13d7248c38 | ||
|
|
3c54954057 | ||
|
|
84823a559d | ||
|
|
d543df768b | ||
|
|
74968389a2 | ||
|
|
1701718515 | ||
|
|
ed6937654c | ||
|
|
73eb6e2e45 | ||
|
|
8b982472a4 | ||
|
|
ab406727d6 | ||
|
|
5fc74a45f7 | ||
|
|
17ecd48cd8 | ||
|
|
4732ce27a6 | ||
|
|
6e10768e7f | ||
|
|
bb47a3705d | ||
|
|
c3e1e92547 | ||
|
|
9ddd768f44 | ||
|
|
62e1ff8ffa | ||
|
|
5f95d135f5 | ||
|
|
8e32d26b0f | ||
|
|
573f064970 | ||
|
|
0bc6f4075b | ||
|
|
4ebcc0ef48 | ||
|
|
57720cf394 | ||
|
|
64b2783f19 | ||
|
|
1dbdd7628a | ||
|
|
4252ec710f | ||
|
|
11d455c284 | ||
|
|
08bc419dc8 | ||
|
|
67c23017d0 | ||
|
|
6e1ba3667c | ||
|
|
0c2f8b903b | ||
|
|
b9335d9cd6 | ||
|
|
0d92092b90 | ||
|
|
e653a41b3f | ||
|
|
82e63c54c4 | ||
|
|
f9c573f598 | ||
|
|
bf8b9cf20d | ||
|
|
0dd5a412d9 | ||
|
|
b389561091 | ||
|
|
6ee055761d | ||
|
|
49f9ff645e | ||
|
|
004cbdb9f7 | ||
|
|
45856a1a81 | ||
|
|
1e615e76e8 | ||
|
|
1c85a685de | ||
|
|
7cd207f40b | ||
|
|
140a8aa90c | ||
|
|
76dcff9d18 | ||
|
|
a9a86d249b | ||
|
|
595760d301 | ||
|
|
6d3f194ce3 | ||
|
|
21c1620f0c | ||
|
|
e78e5af96d | ||
|
|
0fb9700fc7 | ||
|
|
18925ef32c | ||
|
|
f06b990f8a | ||
|
|
75844ae81a | ||
|
|
6bb2323c46 | ||
|
|
7814ca21b5 | ||
|
|
b8806629ec | ||
|
|
4a7f838a0f | ||
|
|
2d07dee4df |
7
.github/workflows/build-multiarch.yml
vendored
7
.github/workflows/build-multiarch.yml
vendored
@@ -6,7 +6,6 @@ on:
|
|||||||
- test/**
|
- test/**
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-*"
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "*.md"
|
- "*.md"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
@@ -39,7 +38,7 @@ jobs:
|
|||||||
- variant: java8-multiarch
|
- variant: java8-multiarch
|
||||||
baseImage: eclipse-temurin:8-jdk
|
baseImage: eclipse-temurin:8-jdk
|
||||||
tagPrefix: java8-
|
tagPrefix: java8-
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
mcVersion: 1.12.2
|
mcVersion: 1.12.2
|
||||||
- variant: java8-openj9
|
- variant: java8-openj9
|
||||||
baseImage: ibm-semeru-runtimes:open-8-jdk
|
baseImage: ibm-semeru-runtimes:open-8-jdk
|
||||||
@@ -71,7 +70,7 @@ jobs:
|
|||||||
itzg/minecraft-server
|
itzg/minecraft-server
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
|
type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
|
||||||
type=ref,event=tag,prefix=${{ matrix.variant }}-
|
type=ref,event=tag,suffix=-${{ matrix.variant }}
|
||||||
type=raw,value=${{ matrix.variant }}
|
type=raw,value=${{ matrix.variant }}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=${{ matrix.variant == 'java17' }}
|
latest=${{ matrix.variant == 'java17' }}
|
||||||
@@ -116,7 +115,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v2.8.0
|
uses: docker/build-push-action@v2.8.0
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.platforms }}
|
platforms: ${{ matrix.platforms }}
|
||||||
push: ${{ github.ref_name == 'master' }}
|
push: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
pull: true
|
pull: true
|
||||||
|
|||||||
2
.github/workflows/discord.yml
vendored
2
.github/workflows/discord.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: discord
|
name: Discord notifications
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
|
|||||||
2
.github/workflows/issue-label.yml
vendored
2
.github/workflows/issue-label.yml
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
name: Issue labels
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|||||||
11
.github/workflows/main.yml
vendored
11
.github/workflows/main.yml
vendored
@@ -4,16 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- java8
|
- java8
|
||||||
- openj9
|
|
||||||
- openj9-11
|
|
||||||
- adopt11
|
|
||||||
- test/alpine/*
|
- test/alpine/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||||
@@ -92,6 +85,4 @@ jobs:
|
|||||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||||
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
||||||
org.opencontainers.image.revision=${{ github.sha }}
|
org.opencontainers.image.revision=${{ github.sha }}
|
||||||
|
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
|
||||||
- name: Image digest
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
|||||||
61
Dockerfile
61
Dockerfile
@@ -1,31 +1,32 @@
|
|||||||
ARG BASE_IMAGE=eclipse-temurin:17-jdk
|
ARG BASE_IMAGE=openjdk:8-jdk-alpine
|
||||||
FROM ${BASE_IMAGE}
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apk add --no-cache -U \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
openssl \
|
||||||
apt-get install -y \
|
imagemagick \
|
||||||
imagemagick \
|
file \
|
||||||
file \
|
lsof \
|
||||||
gosu \
|
su-exec \
|
||||||
sudo \
|
# GNU compatible 'find'
|
||||||
net-tools \
|
findutils \
|
||||||
iputils-ping \
|
shadow \
|
||||||
curl \
|
bash \
|
||||||
git \
|
curl iputils \
|
||||||
jq \
|
git \
|
||||||
dos2unix \
|
jq \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
tzdata \
|
tzdata \
|
||||||
rsync \
|
rsync \
|
||||||
nano \
|
nano \
|
||||||
unzip \
|
sudo \
|
||||||
zstd \
|
knock \
|
||||||
knockd \
|
ttf-dejavu \
|
||||||
ttf-dejavu \
|
zstd
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
RUN addgroup --gid 1000 minecraft \
|
RUN addgroup -g 1000 minecraft \
|
||||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||||
|
&& mkdir -m 777 /data \
|
||||||
|
&& chown minecraft:minecraft /data /home/minecraft
|
||||||
|
|
||||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -33,9 +34,9 @@ EXPOSE 25565 25575
|
|||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
ARG TARGETOS
|
ARG TARGETOS=linux
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH=amd64
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT=""
|
||||||
|
|
||||||
ARG EASY_ADD_VER=0.7.1
|
ARG EASY_ADD_VER=0.7.1
|
||||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
@@ -61,7 +62,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
--var version=0.1.1 --var app=maven-metadata-release --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.16.3
|
ARG MC_HELPER_VERSION=1.16.5
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
||||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||||
| tar -C /usr/share -zxf - \
|
| tar -C /usr/share -zxf - \
|
||||||
@@ -73,7 +74,7 @@ WORKDIR /data
|
|||||||
STOPSIGNAL SIGTERM
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
MEMORY="1G" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST \
|
TYPE=VANILLA VERSION=LATEST \
|
||||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||||
|
|||||||
37
README.md
37
README.md
@@ -68,7 +68,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
|
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
|
||||||
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
|
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
|
||||||
* [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers)
|
* [Downloadable mod/plugin pack for Forge, Fabric, and Bukkit-like Servers](#downloadable-modplugin-pack-for-forge-fabric-and-bukkit-like-servers)
|
||||||
* [<strong>ForgeAPI</strong> usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects)
|
* [ForgeAPI usage to use non-version specific projects](#forgeapi-usage-to-use-non-version-specific-projects)
|
||||||
* [Generic pack files](#generic-pack-files)
|
* [Generic pack files](#generic-pack-files)
|
||||||
* [Mod/Plugin URL Listing File](#modplugin-url-listing-file)
|
* [Mod/Plugin URL Listing File](#modplugin-url-listing-file)
|
||||||
* [Remove old mods/plugins](#remove-old-modsplugins)
|
* [Remove old mods/plugins](#remove-old-modsplugins)
|
||||||
@@ -134,6 +134,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Stop Duration](#stop-duration)
|
* [Stop Duration](#stop-duration)
|
||||||
* [Setup only](#setup-only)
|
* [Setup only](#setup-only)
|
||||||
* [Enable Flare Flags](#enable-flare-flags)
|
* [Enable Flare Flags](#enable-flare-flags)
|
||||||
|
* [Enable timestamps in init logs](#enable-timestamps-in-init-logs)
|
||||||
* [Autopause](#autopause)
|
* [Autopause](#autopause)
|
||||||
* [Description](#description)
|
* [Description](#description)
|
||||||
* [Enabling Autopause](#enabling-autopause)
|
* [Enabling Autopause](#enabling-autopause)
|
||||||
@@ -141,7 +142,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
* [Contributing](#contributing)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Wed Feb 2 02:53:20 UTC 2022 -->
|
<!-- Added by: runner, at: Sat Feb 5 18:38:45 UTC 2022 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -288,7 +289,7 @@ When using the image `itzg:/minecraft-server` without a tag, the `latest` image
|
|||||||
|
|
||||||
| Tag name | Java version | Linux | JVM Type | Architecture |
|
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||||
| -------------- | -------------|--------|----------|-------------------|
|
| -------------- | -------------|--------|----------|-------------------|
|
||||||
| latest | 17 | Debian | Hotspot | amd64,arm64,armv7 |
|
| latest | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| java8 | 8 | Alpine | Hotspot | amd64 |
|
| java8 | 8 | Alpine | Hotspot | amd64 |
|
||||||
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
||||||
@@ -746,9 +747,9 @@ You may also download or copy over individual mods using the `MODS` environment
|
|||||||
|
|
||||||
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
|
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
|
||||||
|
|
||||||
### **ForgeAPI** usage to use non-version specific projects
|
### ForgeAPI usage to use non-version specific projects
|
||||||
|
|
||||||
**NOTE:** This potentially could lead to unexpected behavior if the Mod recieves an update with unexpected behavior.
|
**NOTE:** This potentially could lead to unexpected behavior if the Mod receives an update with unexpected behavior.
|
||||||
|
|
||||||
This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build.
|
This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build.
|
||||||
|
|
||||||
@@ -774,10 +775,10 @@ Example of expected forge api project ids, releases, and key:
|
|||||||
Example of expected ForgeAPI file format.
|
Example of expected ForgeAPI file format.
|
||||||
|
|
||||||
**Field Description**:
|
**Field Description**:
|
||||||
* Name is currently unused, but can be used to document each entry.
|
* `name` is currently unused, but can be used to document each entry.
|
||||||
* Project id is the id found on the CurseForge website for a particular mod
|
* `projectId` id is the id found on the CurseForge website for a particular mod
|
||||||
* Release Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha).
|
* `releaseType` Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha).
|
||||||
* FileName is used for version pinning if latest file will not work for you.
|
* `fileName` is used for version pinning if latest file will not work for you.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
@@ -802,7 +803,7 @@ Example of expected ForgeAPI file format.
|
|||||||
|
|
||||||
### Generic pack files
|
### Generic pack files
|
||||||
|
|
||||||
To install all of the server content (jars, mods, plugins, configs, etc) from a zip or tgz file, such as a CurseForge modpack that is missing a server start script, then set `GENERIC_PACK` to the container path or URL of the archive file.
|
To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
|
||||||
|
|
||||||
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
|
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
|
||||||
|
|
||||||
@@ -816,6 +817,8 @@ GENERIC_PACKS_SUFFIX=.zip
|
|||||||
|
|
||||||
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
|
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
|
||||||
|
|
||||||
|
If applying large generic packs, the update check can be time-consuming since a SHA1 checksum is compared. To skip the update check set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied without comparing the checksum by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
|
||||||
|
|
||||||
### Mod/Plugin URL Listing File
|
### Mod/Plugin URL Listing File
|
||||||
|
|
||||||
As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following
|
As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following
|
||||||
@@ -1559,6 +1562,20 @@ To enable the JVM flags required to fully support the [Flare profiling suite](ht
|
|||||||
|
|
||||||
Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types.
|
Flare is built-in to Airplane/Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types.
|
||||||
|
|
||||||
|
### Enable timestamps in init logs
|
||||||
|
|
||||||
|
Before the container starts the Minecraft Server its output is prefixed with `[init]`, such as
|
||||||
|
|
||||||
|
```
|
||||||
|
[init] Starting the Minecraft server...
|
||||||
|
```
|
||||||
|
|
||||||
|
To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The log output will then look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
|
||||||
|
```
|
||||||
|
|
||||||
## Autopause
|
## Autopause
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ current_uptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java_running() {
|
java_running() {
|
||||||
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
java_process_exists() {
|
java_process_exists() {
|
||||||
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
[[ -n "$(ps -a -o comm | grep 'java')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
rcon_client_exists() {
|
rcon_client_exists() {
|
||||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_server_listening() {
|
mc_server_listening() {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
[unpauseMCServer-server]
|
[unpauseMCServer-server]
|
||||||
sequence = 25565
|
sequence = 25565
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-rcon]
|
[unpauseMCServer-rcon]
|
||||||
sequence = 25575
|
sequence = 25575
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-bedrock]
|
[unpauseMCServer-bedrock]
|
||||||
sequence = 19132:udp
|
sequence = 19132:udp
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||||
# save world
|
# save world
|
||||||
rcon-cli save-all >/dev/null
|
rcon-cli save-all >/dev/null
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||||
logAutopauseAction "Knocked, resuming Java process"
|
logAutopauseAction "Knocked, resuming Java process"
|
||||||
pkill -CONT java
|
pkill -CONT java
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
|||||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
|
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
|
||||||
else
|
else
|
||||||
exec ${SCRIPTS:-/}start-configuration "$@"
|
exec ${SCRIPTS:-/}start-configuration "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -136,8 +136,9 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FTBA)
|
FTBA)
|
||||||
evaluateJavaCompatibilityForForge
|
log "ERROR: TYPE=FTBA is not supported with this image variant."
|
||||||
exec "${SCRIPTS:-/}start-deployFTBA" "$@"
|
log " Use itzg/minecraft-server:java8-multiarch instead."
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
@@ -194,12 +195,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
CRUCIBLE)
|
CRUCIBLE)
|
||||||
log "**********************************************************************"
|
|
||||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
|
||||||
log " since some mods require Java 8"
|
|
||||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
|
||||||
log " can be fixed with java8"
|
|
||||||
log "**********************************************************************"
|
|
||||||
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
|
||||||
|
|
||||||
log "Installing forge server"
|
log "Installing forge server"
|
||||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
||||||
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ if [ ! -d "$librariesDir" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir "$librariesDir"
|
||||||
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
||||||
log "ERROR: failed to unzip Crucible libraries"
|
log "ERROR: failed to unzip Crucible libraries"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ if [[ "${PACKWIZ_URL}" ]]; then
|
|||||||
if [[ -z "${latestPackwiz}" ]]; then
|
if [[ -z "${latestPackwiz}" ]]; then
|
||||||
log "WARNING: Could not retrieve Packwiz bootstrap installer release information"
|
log "WARNING: Could not retrieve Packwiz bootstrap installer release information"
|
||||||
else
|
else
|
||||||
isDebugging && log "Latest packwiz ${latestPackWiz}"
|
isDebugging && log "Latest packwiz ${latestPackwiz}"
|
||||||
latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name')
|
latestPackwizVer=$(echo ${latestPackwiz} | jq --raw-output '.tag_name')
|
||||||
latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url')
|
latestPackwizUrl=$(echo ${latestPackwiz} | jq --raw-output '.assets[] | select(.name | match("packwiz-installer-bootstrap.jar")) | .url')
|
||||||
: "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}"
|
: "${PACKWIZ_JAR:=packwiz-installer-bootstrap_${latestPackwizVer}.jar}"
|
||||||
@@ -199,6 +199,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
pack="${GENERIC_PACKS_PREFIX}${packEntry}${GENERIC_PACKS_SUFFIX}"
|
pack="${GENERIC_PACKS_PREFIX}${packEntry}${GENERIC_PACKS_SUFFIX}"
|
||||||
if isURL "${pack}"; then
|
if isURL "${pack}"; then
|
||||||
mkdir -p /data/packs
|
mkdir -p /data/packs
|
||||||
|
log "Downloading generic pack from $pack"
|
||||||
if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then
|
if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then
|
||||||
log "ERROR: failed to download $pack"
|
log "ERROR: failed to download $pack"
|
||||||
exit 2
|
exit 2
|
||||||
@@ -210,7 +211,13 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
||||||
if ! sha1sum -c "${sum_file}" --status 2> /dev/null; then
|
|
||||||
|
log "Checking if generic packs are up to date"
|
||||||
|
if isTrue "${SKIP_GENERIC_PACK_UPDATE_CHECK:-false}" && [ -f "$sum_file" ]; then
|
||||||
|
log "Skipping generic pack update check"
|
||||||
|
elif isTrue "${FORCE_GENERIC_PACK_UPDATE}" || ! sha1sum -c "${sum_file}" --status 2> /dev/null; then
|
||||||
|
log "Generic pack(s) are out of date. Re-applying..."
|
||||||
|
|
||||||
base_dir=/tmp/generic_pack_base
|
base_dir=/tmp/generic_pack_base
|
||||||
mkdir -p ${base_dir}
|
mkdir -p ${base_dir}
|
||||||
for pack in "${packFiles[@]}"; do
|
for pack in "${packFiles[@]}"; do
|
||||||
@@ -243,6 +250,7 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
cp -R -f "${base_dir}"/* /data
|
cp -R -f "${base_dir}"/* /data
|
||||||
rm -rf /tmp/generic_pack_base
|
rm -rf /tmp/generic_pack_base
|
||||||
|
|
||||||
|
log "Saving generic pack(s) checksum"
|
||||||
sha1sum "${packFiles[@]}" > "${sum_file}"
|
sha1sum "${packFiles[@]}" > "${sum_file}"
|
||||||
isDebugging && cat "$sum_file"
|
isDebugging && cat "$sum_file"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ function getFilenameFromUrl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isTrue() {
|
function isTrue() {
|
||||||
|
local oldState
|
||||||
|
oldState=$(shopt -po xtrace)
|
||||||
|
shopt -u -o xtrace
|
||||||
|
|
||||||
local value=${1,,}
|
local value=${1,,}
|
||||||
|
|
||||||
result=
|
result=
|
||||||
@@ -53,6 +57,7 @@ function isTrue() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
eval "$oldState"
|
||||||
return ${result}
|
return ${result}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +87,18 @@ function logn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function log() {
|
function log() {
|
||||||
echo "[init] $*"
|
local oldState
|
||||||
|
# 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
|
||||||
|
|
||||||
|
if isDebugging || isTrue "${LOG_TIMESTAMP:-false}"; then
|
||||||
|
ts=" $(date --rfc-3339=seconds)"
|
||||||
|
else
|
||||||
|
ts=
|
||||||
|
fi
|
||||||
|
echo "[init]${ts} $*"
|
||||||
|
eval "$oldState"
|
||||||
}
|
}
|
||||||
|
|
||||||
function logAutopause() {
|
function logAutopause() {
|
||||||
@@ -211,7 +227,7 @@ function extract() {
|
|||||||
application/zip)
|
application/zip)
|
||||||
unzip -q -d "${destDir}" "${src}"
|
unzip -q -d "${destDir}" "${src}"
|
||||||
;;
|
;;
|
||||||
application/x-tar|application/gzip|application/x-gzip|application/x-bzip2|application/zstd)
|
application/x-tar|application/gzip|application/x-gzip|application/x-bzip2|application/zstd|application/x-zstd)
|
||||||
tar -C "${destDir}" -xf "${src}"
|
tar -C "${destDir}" -xf "${src}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -11,8 +11,14 @@ services:
|
|||||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
environment:
|
environment:
|
||||||
EULA: "true"
|
EULA: "true"
|
||||||
SETUP_ONLY: "TRUE"
|
SETUP_ONLY: "true"
|
||||||
GENERIC_PACKS: http://web/configs.zip,/packs/testing.zip
|
GENERIC_PACKS: http://web/configs.zip,/packs/testing.zip
|
||||||
|
LOG_TIMESTAMP: "true"
|
||||||
|
# the following are only used to speed up test execution
|
||||||
|
TYPE: CUSTOM
|
||||||
|
CUSTOM_SERVER: /servers/fake.jar
|
||||||
|
VERSION: 1.18.1
|
||||||
volumes:
|
volumes:
|
||||||
- ./packs:/packs
|
- ./packs:/packs
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
- ./fake.jar:/servers/fake.jar
|
||||||
|
|||||||
0
tests/setuponlytests/generic-packs/fake.jar
Normal file
0
tests/setuponlytests/generic-packs/fake.jar
Normal file
Reference in New Issue
Block a user