mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
158 Commits
2021.11.0-
...
2021.12.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
521099b733 | ||
|
|
02181021ce | ||
|
|
fa60f8c16e | ||
|
|
3084a2f409 | ||
|
|
f473cfc6f2 | ||
|
|
f297654bb6 | ||
|
|
cc204c297f | ||
|
|
01bd8f5860 | ||
|
|
671e84bec9 | ||
|
|
fc2ba2df32 | ||
|
|
e5bee8e79b | ||
|
|
1b13ddcf32 | ||
|
|
de707049d4 | ||
|
|
e95ae2dbbb | ||
|
|
4606c27cdc | ||
|
|
ba88bf72ce | ||
|
|
75967cec02 | ||
|
|
0a35f661bd | ||
|
|
f141806fb4 | ||
|
|
d80f40075c | ||
|
|
44dbe80096 | ||
|
|
c7546ef08a | ||
|
|
6fe5bb4aa8 | ||
|
|
589a9aa3db | ||
|
|
34ae93f379 | ||
|
|
bd57d291c1 | ||
|
|
7310daf51d | ||
|
|
78d9d888db | ||
|
|
bccdc7f5e8 | ||
|
|
3854526389 | ||
|
|
74072847ca | ||
|
|
c5857bfc0b | ||
|
|
8b380894f9 | ||
|
|
b090737162 | ||
|
|
476abc9dad | ||
|
|
a2cbf07b6d | ||
|
|
2a67344b93 | ||
|
|
9ecb617d2e | ||
|
|
9381776345 | ||
|
|
5a47bb11ba | ||
|
|
4be4fc4808 | ||
|
|
d939be28e6 | ||
|
|
bb8c7756c7 | ||
|
|
185fccf712 | ||
|
|
0c860ade12 | ||
|
|
0f0017b02d | ||
|
|
a99f7a494b | ||
|
|
5e8f947ce5 | ||
|
|
3e9308d315 | ||
|
|
e593ca4bda | ||
|
|
b731eaaffb | ||
|
|
a3039eea12 | ||
|
|
cbf9577a24 | ||
|
|
10a3037ab3 | ||
|
|
9ccfca5061 | ||
|
|
6fab527eed | ||
|
|
9690832247 | ||
|
|
60a68963a8 | ||
|
|
e5948081a7 | ||
|
|
298bf5fb0a | ||
|
|
6ae431b2f0 | ||
|
|
44769b6001 | ||
|
|
ebabfeb669 | ||
|
|
4186cfd91c | ||
|
|
457e9b53c7 | ||
|
|
21572d3547 | ||
|
|
89afba7437 | ||
|
|
f397dd71a9 | ||
|
|
02e0a47a52 | ||
|
|
b176be942d | ||
|
|
60809fe5ad | ||
|
|
51c5902db0 | ||
|
|
4a8e416fe1 | ||
|
|
090e624ebc | ||
|
|
ce4efd0b70 | ||
|
|
c8dc751b82 | ||
|
|
f856276d71 | ||
|
|
0300854c46 | ||
|
|
7c862df92a | ||
|
|
e49c1c2f01 | ||
|
|
57390b02ca | ||
|
|
f06e9f5ede | ||
|
|
a698248dff | ||
|
|
b8ef6eba3f | ||
|
|
8d3ca813ed | ||
|
|
cc5fe0859a | ||
|
|
e97a00e61d | ||
|
|
8f15aac6fc | ||
|
|
b519c43e16 | ||
|
|
84ce3b4b47 | ||
|
|
02c8393bc6 | ||
|
|
b07c43a32f | ||
|
|
9469291731 | ||
|
|
ce1b337f7f | ||
|
|
c29baf446d | ||
|
|
ee8e1b9322 | ||
|
|
f9b8db0715 | ||
|
|
20bd5c4c36 | ||
|
|
ffb50cfe28 | ||
|
|
de082d0fb2 | ||
|
|
51e6d5dfbd | ||
|
|
3cc5cdbc06 | ||
|
|
842c69fd80 | ||
|
|
c458823014 | ||
|
|
b69ec47b18 | ||
|
|
32abf1614f | ||
|
|
51fc8e824d | ||
|
|
a916cc8320 | ||
|
|
aff9031284 | ||
|
|
01130757d6 | ||
|
|
397d080da2 | ||
|
|
f97b3bf82e | ||
|
|
cb5d052829 | ||
|
|
b7bcd252d3 | ||
|
|
0908d21bed | ||
|
|
aa43926da2 | ||
|
|
4d878985d4 | ||
|
|
34c45ec883 | ||
|
|
72d7d4a65e | ||
|
|
cb0add3b90 | ||
|
|
71a48ce10f | ||
|
|
9bacaa11d8 | ||
|
|
c7c4c7497a | ||
|
|
e442baab31 | ||
|
|
8101c8b51c | ||
|
|
eba1ef6ab9 | ||
|
|
6462e1580c | ||
|
|
8b5552bb62 | ||
|
|
3ca514f2b2 | ||
|
|
c07f899870 | ||
|
|
e527fd9551 | ||
|
|
047a477f7b | ||
|
|
78cb05adda | ||
|
|
8493252645 | ||
|
|
aa42633ab2 | ||
|
|
9ec336283f | ||
|
|
bbdb2c9b36 | ||
|
|
48e09f42fc | ||
|
|
ec7d182d38 | ||
|
|
9c7c95cf4f | ||
|
|
e32ffd1819 | ||
|
|
095c6ad099 | ||
|
|
14342c9632 | ||
|
|
f6df4d6694 | ||
|
|
0406e89c2a | ||
|
|
5ef21e1ddf | ||
|
|
414d5bd8ac | ||
|
|
15ccf03b28 | ||
|
|
828a48998f | ||
|
|
4b590e03ff | ||
|
|
0db8780ad9 | ||
|
|
5b744176df | ||
|
|
20b15e0330 | ||
|
|
818539e3de | ||
|
|
f48741f65c | ||
|
|
e9e5af849f | ||
|
|
22d68f5c7c | ||
|
|
690598da60 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
57
.github/workflows/build-multiarch.yml
vendored
57
.github/workflows/build-multiarch.yml
vendored
@@ -3,56 +3,50 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- multiarch
|
||||
- java8-multiarch
|
||||
- multiarch-latest
|
||||
- java15
|
||||
- java15-openj9
|
||||
- java16
|
||||
- test/multiarch/*
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java16"
|
||||
paths-ignore:
|
||||
- "*.md"
|
||||
- "docs/**"
|
||||
- "examples/**"
|
||||
|
||||
jobs:
|
||||
docker-buildx:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.2.0
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=itzg/minecraft-server
|
||||
VERSION=edge
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
fi
|
||||
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/heads/}
|
||||
if [[ $VERSION == master ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
fi
|
||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
echo ::set-output name=cache_from::${TAGS}
|
||||
echo ::set-output name=version::${VERSION//\//-}
|
||||
echo ::set-output name=cache_version::${VERSION//\//-}
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: |
|
||||
itzg/minecraft-server
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v2.1.5
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||
key: ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||
${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v1.1.0
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
@@ -62,22 +56,17 @@ jobs:
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v2.4.0
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
labels: |
|
||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
20
.github/workflows/generate-toc.yml
vendored
Normal file
20
.github/workflows/generate-toc.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Generate README table of contents
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- README.md
|
||||
jobs:
|
||||
generate:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- run: |
|
||||
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
||||
chmod a+x gh-md-toc
|
||||
./gh-md-toc --insert --no-backup README.md
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
|
||||
with:
|
||||
commit_message: Auto update markdown TOC
|
||||
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v2.1.5
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v2.4.0
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
|
||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/data/
|
||||
/.idea/
|
||||
*.iml
|
||||
*.iml
|
||||
/gh-md-toc
|
||||
11
BUILDING.md
Normal file
11
BUILDING.md
Normal file
@@ -0,0 +1,11 @@
|
||||
Ensure buildx/BuildKit support is enabled and run:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
|
||||
```
|
||||
|
||||
To build for local testing, use:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
|
||||
```
|
||||
52
Dockerfile
52
Dockerfile
@@ -1,29 +1,29 @@
|
||||
FROM openjdk:8u212-jre-alpine
|
||||
FROM adoptopenjdk:15-jre
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
RUN apk add --no-cache -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
sudo \
|
||||
knock \
|
||||
ttf-dejavu
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
gosu \
|
||||
sudo \
|
||||
net-tools \
|
||||
curl wget \
|
||||
git \
|
||||
jq \
|
||||
dos2unix \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
unzip \
|
||||
knockd \
|
||||
ttf-dejavu \
|
||||
&& apt-get clean
|
||||
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir -m 777 /data \
|
||||
&& chown minecraft:minecraft /data /home/minecraft
|
||||
RUN addgroup --gid 1000 minecraft \
|
||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||
|
||||
COPY files/sudoers* /etc/sudoers.d
|
||||
|
||||
@@ -31,9 +31,9 @@ EXPOSE 25565 25575
|
||||
|
||||
# hook into docker BuildKit --platform support
|
||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH=amd64
|
||||
ARG TARGETVARIANT=""
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
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
|
||||
@@ -69,7 +69,7 @@ WORKDIR /data
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||
MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||
|
||||
315
README.md
315
README.md
@@ -38,6 +38,115 @@ With that you can easily view the logs, stop, or re-start the container:
|
||||
|
||||
> Be sure to always include `-e EULA=TRUE` in your commands, as Mojang/Microsoft requires EULA acceptance.
|
||||
|
||||
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](#versions) and the [`TYPE`](#server-types) can be configured to create many variations of desired Minecraft server.
|
||||
|
||||
**TABLE OF CONTENTS**
|
||||
|
||||
<!--ts-->
|
||||
* [Looking for a Bedrock Dedicated Server](#looking-for-a-bedrock-dedicated-server)
|
||||
* [Interacting with the server](#interacting-with-the-server)
|
||||
* [Data Directory](#data-directory)
|
||||
* [Attaching data directory to host filesystem](#attaching-data-directory-to-host-filesystem)
|
||||
* [Converting anonymous /data volume to named volume](#converting-anonymous-data-volume-to-named-volume)
|
||||
* [Versions](#versions)
|
||||
* [Running Minecraft server on different Java version](#running-minecraft-server-on-different-java-version)
|
||||
* [Deprecated Image Tags](#deprecated-image-tags)
|
||||
* [Healthcheck](#healthcheck)
|
||||
* [Deployment Templates and Examples](#deployment-templates-and-examples)
|
||||
* [Helm Charts](#helm-charts)
|
||||
* [Examples](#examples)
|
||||
* [Amazon Web Services (AWS) Deployment](#amazon-web-services-aws-deployment)
|
||||
* [Server types](#server-types)
|
||||
* [Running a Forge Server](#running-a-forge-server)
|
||||
* [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server)
|
||||
* [Running a Paper server](#running-a-paper-server)
|
||||
* [Running a Tuinity server](#running-a-tuinity-server)
|
||||
* [Running an Airplane server](#running-an-airplane-server)
|
||||
* [Running a Purpur server](#running-a-purpur-server)
|
||||
* [Running a Yatopia server](#running-a-yatopia-server)
|
||||
* [Running a Magma server](#running-a-magma-server)
|
||||
* [Running a Mohist server](#running-a-mohist-server)
|
||||
* [Running a Catserver type server](#running-a-catserver-type-server)
|
||||
* [Running an Canyon server](#running-an-canyon-server)
|
||||
* [Running a SpongeVanilla server](#running-a-spongevanilla-server)
|
||||
* [Running a Fabric Server](#running-a-fabric-server)
|
||||
* [Running a server with a Feed the Beast modpack](#running-a-server-with-a-feed-the-beast-modpack)
|
||||
* [Environment Variables:](#environment-variables)
|
||||
* [Upgrading](#upgrading)
|
||||
* [Example](#example)
|
||||
* [Running a server with a CurseForge modpack](#running-a-server-with-a-curseforge-modpack)
|
||||
* [Modpack data directory](#modpack-data-directory)
|
||||
* [Buggy start scripts](#buggy-start-scripts)
|
||||
* [Fixing "unable to launch forgemodloader"](#fixing-unable-to-launch-forgemodloader)
|
||||
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
|
||||
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
|
||||
* [Replacing variables inside configs](#replacing-variables-inside-configs)
|
||||
* [Running with a custom server JAR](#running-with-a-custom-server-jar)
|
||||
* [Force re-download of the server file](#force-re-download-of-the-server-file)
|
||||
* [Using Docker Compose](#using-docker-compose)
|
||||
* [Server configuration](#server-configuration)
|
||||
* [Server name](#server-name)
|
||||
* [Server port](#server-port)
|
||||
* [Difficulty](#difficulty)
|
||||
* [Whitelist Players](#whitelist-players)
|
||||
* [Op/Administrator Players](#opadministrator-players)
|
||||
* [Server icon](#server-icon)
|
||||
* [Rcon](#rcon)
|
||||
* [Query](#query)
|
||||
* [Max players](#max-players)
|
||||
* [Max world size](#max-world-size)
|
||||
* [Allow Nether](#allow-nether)
|
||||
* [Announce Player Achievements](#announce-player-achievements)
|
||||
* [Enable Command Block](#enable-command-block)
|
||||
* [Force Gamemode](#force-gamemode)
|
||||
* [Generate Structures](#generate-structures)
|
||||
* [Hardcore](#hardcore)
|
||||
* [Snooper](#snooper)
|
||||
* [Max Build Height](#max-build-height)
|
||||
* [Max Tick Time](#max-tick-time)
|
||||
* [Spawn Animals](#spawn-animals)
|
||||
* [Spawn Monsters](#spawn-monsters)
|
||||
* [Spawn NPCs](#spawn-npcs)
|
||||
* [Set spawn protection](#set-spawn-protection)
|
||||
* [View Distance](#view-distance)
|
||||
* [Level Seed](#level-seed)
|
||||
* [Game Mode](#game-mode)
|
||||
* [Message of the Day](#message-of-the-day)
|
||||
* [PVP Mode](#pvp-mode)
|
||||
* [Level Type and Generator Settings](#level-type-and-generator-settings)
|
||||
* [Custom Server Resource Pack](#custom-server-resource-pack)
|
||||
* [World Save Name](#world-save-name)
|
||||
* [Downloadable world](#downloadable-world)
|
||||
* [Cloning world from a container path](#cloning-world-from-a-container-path)
|
||||
* [Overwrite world on start](#overwrite-world-on-start)
|
||||
* [Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers](#downloadable-modplugin-pack-for-forge-bukkit-and-spigot-servers)
|
||||
* [Remove old mods/plugins](#remove-old-modsplugins)
|
||||
* [Online mode](#online-mode)
|
||||
* [Allow flight](#allow-flight)
|
||||
* [Other server property mappings](#other-server-property-mappings)
|
||||
* [Miscellaneous Options](#miscellaneous-options)
|
||||
* [Running as alternate user/group ID](#running-as-alternate-usergroup-id)
|
||||
* [Memory Limit](#memory-limit)
|
||||
* [JVM Options](#jvm-options)
|
||||
* [Interactive and Color Console](#interactive-and-color-console)
|
||||
* [OpenJ9 Specific Options](#openj9-specific-options)
|
||||
* [Enabling rolling logs](#enabling-rolling-logs)
|
||||
* [Timezone Configuration](#timezone-configuration)
|
||||
* [Enable Remote JMX for Profiling](#enable-remote-jmx-for-profiling)
|
||||
* [Enable Aikar's Flags](#enable-aikars-flags)
|
||||
* [HTTP Proxy](#http-proxy)
|
||||
* [Using "noconsole" option](#using-noconsole-option)
|
||||
* [Explicitly disable GUI](#explicitly-disable-gui)
|
||||
* [Stop Duration](#stop-duration)
|
||||
* [Autopause](#autopause)
|
||||
* [Description](#description)
|
||||
* [Enabling Autopause](#enabling-autopause)
|
||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||
|
||||
<!-- Added by: runner, at: Thu May 20 01:17:11 UTC 2021 -->
|
||||
|
||||
<!--te-->
|
||||
|
||||
## Looking for a Bedrock Dedicated Server
|
||||
|
||||
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
||||
@@ -101,7 +210,7 @@ When attached in this way you can stop the server, edit the configuration under
|
||||
With Docker Compose, setting up a host attached directory is even easier since relative paths can be configured. For example, with the following `docker-compose.yml` Docker will automatically create/attach the relative directory `minecraft-data` to the container.
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
@@ -159,6 +268,8 @@ the server jar remain in the `/data` directory. It is safe to remove those._
|
||||
|
||||
## Running Minecraft server on different Java version
|
||||
|
||||
> **NOTE** [as of snapshot 21W19A](https://www.minecraft.net/en-us/article/minecraft-snapshot-21w19a), Java 16 is now required. Please use `itzg/minecraft-server:java16` for that version and newer. Consideration of changing the `latest` will be made after 1.17 releases.
|
||||
|
||||
To use a different version of Java, please use a docker tag to run your Minecraft server.
|
||||
|
||||
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||
@@ -168,6 +279,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf
|
||||
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| java15-openj9 | 15 | Debian | OpenJ9 | amd64,arm64 |
|
||||
| java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| adopt11 | 11 | Alpine | Hotspot | amd64 |
|
||||
| openj9 | 8 | Alpine | OpenJ9 | amd64 |
|
||||
| openj9-11 | 11 | Alpine | OpenJ9 | amd64 |
|
||||
@@ -212,7 +324,9 @@ Some orchestration systems, such as Portainer, don't allow for disabling the def
|
||||
|
||||
### Helm Charts
|
||||
|
||||
- [stable/minecraft](https://hub.helm.sh/charts/stable/minecraft) ([chart source](https://github.com/helm/charts/tree/master/stable/minecraft))
|
||||
- itzg Helm Chart:
|
||||
- [GitHub repo](https://github.com/itzg/minecraft-server-charts)
|
||||
- [Helm Chart repo](https://itzg.github.io/minecraft-server-charts/)
|
||||
- [mcsh/server-deployment](https://github.com/mcserverhosting-net/charts)
|
||||
|
||||
### Examples
|
||||
@@ -223,13 +337,15 @@ The [examples directory](https://github.com/itzg/docker-minecraft-server/tree/ma
|
||||
|
||||
If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the [Minecraft Server Deployment (CloudFormation) repository](https://github.com/vatertime/minecraft-spot-pricing). This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use.
|
||||
|
||||
## Running a Forge Server
|
||||
## Server types
|
||||
|
||||
### Running a Forge Server
|
||||
|
||||
Enable [Forge server](http://www.minecraftforge.net/wiki/) mode by adding a `-e TYPE=FORGE` to your command-line.
|
||||
|
||||
The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGEVERSION`, such as `-e FORGEVERSION=14.23.5.2854`.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data \
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FORGE \
|
||||
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
@@ -237,36 +353,18 @@ The overall version is specified by `VERSION`, [as described in the section abov
|
||||
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
|
||||
specify the name of the installer file with `FORGE_INSTALLER`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER=forge-1.11.2-13.20.0.2228-installer.jar ...
|
||||
|
||||
To download a Forge installer from a custom location, such as your own file repository, specify
|
||||
the URL with `FORGE_INSTALLER_URL`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER_URL=http://HOST/forge-1.11.2-13.20.0.2228-installer.jar ...
|
||||
|
||||
In both of the cases above, there is no need for the `VERSION` or `FORGEVERSION` variables.
|
||||
|
||||
### Managing mods
|
||||
|
||||
In order to manage mods, you have two options:
|
||||
|
||||
1. [Attach a host directory to the /data path](#attaching-data-directory-to-host-filesystem) and manage the contents of the `mods` subdirectory
|
||||
|
||||
2. Using a mods-mount
|
||||
|
||||
If the container paths `/mods` and/or `/config` exist, such as by attaching a docker volume or host path, then any files in either of these directories will be copied over to the respective `/data` subdirectory before starting Minecraft.
|
||||
|
||||
If you want old mods to be removed as the `/mods` content is updated, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables. By default, everything will be removed. You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.
|
||||
|
||||
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
|
||||
|
||||
You can specify the destination of the files that are copied from `/mods` and `/config` by setting the `COPY_MODS_DEST` and `COPY_CONFIG_DEST`, where the default is `/data/mods` and `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
||||
|
||||
> NOTE: If a file was updated in the destination path and is newer than the source file from `/config`, then it will not be overwritten.
|
||||
|
||||
## Running a Bukkit/Spigot server
|
||||
### Running a Bukkit/Spigot server
|
||||
|
||||
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
|
||||
|
||||
@@ -287,7 +385,7 @@ Plugins can either be managed within the `plugins` subdirectory of the [data dir
|
||||
|
||||
> NOTE some of the `VERSION` values are not as intuitive as you would think, so make sure to click into the version entry to find the **exact** version needed for the download. For example, "1.8" is not sufficient since their download naming expects `1.8-R0.1-SNAPSHOT-latest` exactly.
|
||||
|
||||
## Running a Paper server
|
||||
### Running a Paper server
|
||||
|
||||
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
|
||||
|
||||
@@ -309,7 +407,7 @@ If you have attached a host directory to the `/data` volume, then you can instal
|
||||
|
||||
[You can also auto-download plugins using `SPIGET_RESOURCES`.](#auto-downloading-spigotmcbukkitpapermc-plugins)
|
||||
|
||||
## Running a Tuinity server
|
||||
### Running a Tuinity server
|
||||
|
||||
A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts.
|
||||
|
||||
@@ -317,7 +415,7 @@ A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of P
|
||||
|
||||
> **NOTE** only `VERSION=LATEST` is supported
|
||||
|
||||
## Running an Airplane server
|
||||
### Running an Airplane server
|
||||
|
||||
An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of Tuinity aimed at further improving server performance at high playercounts.
|
||||
|
||||
@@ -331,7 +429,7 @@ Extra variables:
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Purpur server
|
||||
### Running a Purpur server
|
||||
|
||||
A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper, Tuinity, Airplane with the goal of providing new and interesting configuration options".
|
||||
|
||||
@@ -344,7 +442,7 @@ Extra variables:
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Yatopia server
|
||||
### Running a Yatopia server
|
||||
|
||||
A [Yatopia](https://github.com/YatopiaMC/Yatopia) server, which is a "blazing fast Tuinity fork with best in class performance".
|
||||
|
||||
@@ -357,7 +455,7 @@ Extra variables:
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||
|
||||
## Running a Magma server
|
||||
### Running a Magma server
|
||||
|
||||
A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with
|
||||
|
||||
@@ -366,7 +464,7 @@ A [Magma](https://magmafoundation.org/) server, which is a combination of Forge
|
||||
> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
|
||||
|
||||
|
||||
## Running a Mohist server
|
||||
### Running a Mohist server
|
||||
|
||||
A [Mohist](https://github.com/Mohist-Community/Mohist) server can be used with
|
||||
|
||||
@@ -378,7 +476,7 @@ By default the latest build will be used; however, a specific build number can b
|
||||
|
||||
-e VERSION=1.16.5 -e MOHIST_BUILD=374
|
||||
|
||||
## Running a Catserver type server
|
||||
### Running a Catserver type server
|
||||
|
||||
A [Catserver](http://catserver.moe/) type server can be used with
|
||||
|
||||
@@ -386,6 +484,63 @@ A [Catserver](http://catserver.moe/) type server can be used with
|
||||
|
||||
> **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored
|
||||
|
||||
### Running an Canyon server
|
||||
|
||||
[Canyon](https://github.com/canyonmodded/canyon) is a fork of CraftBukkit for Minecraft Beta 1.7.3. It includes multiple enhancements whilst also retaining compatibility with old Bukkit plugins and mods as much as possible.
|
||||
|
||||
-e VERSION=b1.7.3 -e TYPE=CANYON
|
||||
|
||||
> **NOTE** only `VERSION=b1.7.3` is supported
|
||||
|
||||
> **NOTE** only Java 8 is supported
|
||||
|
||||
By default the latest build will be used; however, a specific build number can be selected by setting `CANYON_BUILD`, such as
|
||||
|
||||
-e CANYON_BUILD=11
|
||||
|
||||
### Running a SpongeVanilla server
|
||||
|
||||
Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line.
|
||||
By default the container will run the latest `STABLE` version.
|
||||
If you want to run a specific version, you can add `-e SPONGEVERSION=1.11.2-6.1.0-BETA-19` to your command-line.
|
||||
|
||||
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
You can also choose to use the `EXPERIMENTAL` branch.
|
||||
Just change it with `SPONGEBRANCH`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
|
||||
|
||||
### Running a Fabric Server
|
||||
|
||||
Enable [Fabric server](http://fabricmc.net/use/) mode by adding a `-e TYPE=FABRIC` to your command-line. By default, the container will run the latest version, but you can also choose to run a specific version with `VERSION`.
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FABRIC \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
|
||||
A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`.
|
||||
|
||||
To use a pre-downloaded Fabric installer, place it in a directory attached into the container, such as the `/data` volume and specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
To download a Fabric installer from a custom location, such as your own file repository, specify the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
In order to add mods, you have two options:
|
||||
|
||||
## Running a server with a Feed the Beast modpack
|
||||
|
||||
> **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version).
|
||||
@@ -457,76 +612,6 @@ then you apply a workaround by adding this to the run invocation:
|
||||
|
||||
-e FTB_LEGACYJAVAFIXER=true
|
||||
|
||||
## Running a SpongeVanilla server
|
||||
|
||||
Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line.
|
||||
By default the container will run the latest `STABLE` version.
|
||||
If you want to run a specific version, you can add `-e SPONGEVERSION=1.11.2-6.1.0-BETA-19` to your command-line.
|
||||
|
||||
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
You can also choose to use the `EXPERIMENTAL` branch.
|
||||
Just change it with `SPONGEBRANCH`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
|
||||
|
||||
## Running a Fabric Server
|
||||
|
||||
Enable [Fabric server](http://fabricmc.net/use/) mode by adding a `-e TYPE=FABRIC` to your command-line. By default, the container will run the latest version, but you can also choose to run a specific version with `VERSION`.
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FABRIC \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
|
||||
A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`.
|
||||
|
||||
To use a pre-downloaded Fabric installer, place it in a directory attached into the container, such as the `/data` volume and specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
To download a Fabric installer from a custom location, such as your own file repository, specify the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
In order to add mods, you have two options:
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
This is the easiest way if you are using a persistent `/data` mount.
|
||||
|
||||
To do this, you will need to attach the container's `/data` directory
|
||||
(see "Attaching data directory to host filesystem”).
|
||||
Then, you can add mods to the `/path/on/host/mods` folder you chose. From the example above,
|
||||
the `/path/on/host` folder contents look like:
|
||||
|
||||
```
|
||||
/path/on/host
|
||||
├── mods
|
||||
│ └── ... INSTALL MODS HERE ...
|
||||
├── config
|
||||
│ └── ... CONFIGURE MODS HERE ...
|
||||
├── ops.json
|
||||
├── server.properties
|
||||
├── whitelist.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
If you add mods while the container is running, you'll need to restart it to pick those
|
||||
up:
|
||||
|
||||
docker stop mc
|
||||
docker start mc
|
||||
|
||||
## Optional plugins, mods, and config attach points
|
||||
|
||||
There are optional volume paths that can be attached to supply content to be copied into the data area:
|
||||
@@ -540,8 +625,16 @@ There are optional volume paths that can be attached to supply content to be cop
|
||||
`/config`
|
||||
: contents are copied into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`
|
||||
|
||||
If you want old mods/plugins to be removed before the content is brought over from those attach points, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables. By default, everything will be removed. You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.
|
||||
|
||||
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
|
||||
|
||||
You can specify the destination of the files that are copied from `/mods` and `/config` by setting the `COPY_MODS_DEST` and `COPY_CONFIG_DEST`, where the default is `/data/mods` and `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
||||
|
||||
These paths work well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
|
||||
|
||||
> For more flexibility with mods/plugins preparation, you can declare directories to use in [the `MODS` variable](#downloadable-modplugin-pack-for-forge-bukkit-and-spigot-servers)
|
||||
|
||||
## Auto-downloading SpigotMC/Bukkit/PaperMC plugins
|
||||
|
||||
The `SPIGET_RESOURCES` variable can be set with a comma-separated list of SpigotMC resource IDs to automatically download [SpigotMC resources/plugins](https://www.spigotmc.org/resources/) using [the spiget API](https://spiget.org/). Resources that are zip files will be expanded into the plugins directory and resources that are simply jar files will be moved there.
|
||||
@@ -612,7 +705,7 @@ database:
|
||||
This is how your `docker-compose.yml` file could look like:
|
||||
|
||||
```yml
|
||||
version: "3"
|
||||
version: "3.8"
|
||||
# Other docker-compose examples in /examples
|
||||
|
||||
services:
|
||||
@@ -687,7 +780,9 @@ every time you want to create new Minecraft server, you can now use
|
||||
[Docker Compose](https://docs.docker.com/compose/). Start with a
|
||||
`docker-compose.yml` file like the following:
|
||||
|
||||
```
|
||||
```yml
|
||||
version: "3.8"
|
||||
|
||||
minecraft-server:
|
||||
image: itzg/minecraft-server
|
||||
|
||||
@@ -1016,7 +1111,7 @@ The world will only be downloaded or copied if it doesn't exist already. Set `FO
|
||||
|
||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||
|
||||
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||
Like the `WORLD` option above, you can specify the URL or path of a "mod pack"
|
||||
to download and install into `mods` for Forge or `plugins` for Bukkit/Spigot.
|
||||
To use this option pass the environment variable `MODPACK`, such as
|
||||
|
||||
@@ -1026,10 +1121,12 @@ To use this option pass the environment variable `MODPACK`, such as
|
||||
top level of the zip archive. Make sure the jars are compatible with the
|
||||
particular `TYPE` of server you are running.
|
||||
|
||||
You may also download individual mods using the `MODS` environment variable and supplying the URL
|
||||
to the jar files. Multiple mods/plugins should be comma separated.
|
||||
You may also download or copy over individual mods using the `MODS` environment variable. `MODS` contains a comma-separated list of
|
||||
- URL of a jar file
|
||||
- container path to a jar file
|
||||
- container path to a directory containing jar files
|
||||
|
||||
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,https://www.example.com/mods/mod2.jar ...
|
||||
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
|
||||
|
||||
### Remove old mods/plugins
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ branches_list=(
|
||||
'adopt11'
|
||||
'java15'
|
||||
'java15-openj9'
|
||||
'java16'
|
||||
'multiarch'
|
||||
'multiarch-latest'
|
||||
)
|
||||
|
||||
0
docs/.gitkeep
Normal file
0
docs/.gitkeep
Normal file
BIN
docs/world-copy-compose-project.drawio.png
Normal file
BIN
docs/world-copy-compose-project.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.2'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.7'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
||||
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
||||
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -5,15 +5,15 @@ current_uptime() {
|
||||
}
|
||||
|
||||
java_running() {
|
||||
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
}
|
||||
|
||||
java_process_exists() {
|
||||
[[ -n "$(ps -a -o comm | grep 'java')" ]]
|
||||
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
||||
}
|
||||
|
||||
rcon_client_exists() {
|
||||
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
[unpauseMCServer-server]
|
||||
sequence = 25565
|
||||
seq_timeout = 1
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-rcon]
|
||||
sequence = 25575
|
||||
seq_timeout = 1
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
# save world
|
||||
rcon-cli save-all >/dev/null
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
logAutopauseAction "Knocked, resuming Java process"
|
||||
pkill -CONT java
|
||||
fi
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||
echo "Healthcheck disabled"
|
||||
exit 0
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
|
||||
2
start
2
start
@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
||||
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||
else
|
||||
exec ${SCRIPTS:-/}start-configuration $@
|
||||
fi
|
||||
|
||||
@@ -13,6 +13,8 @@ shopt -s nullglob
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if ! isTrue "$EULA"; then
|
||||
log ""
|
||||
@@ -28,15 +30,6 @@ if [ ! -e /data/eula.txt ]; then
|
||||
fi
|
||||
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if ! touch /data/.verify_access; then
|
||||
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
rm /data/.verify_access || true
|
||||
|
||||
if [[ $PROXY ]]; then
|
||||
export http_proxy="$PROXY"
|
||||
export https_proxy="$PROXY"
|
||||
@@ -63,7 +56,7 @@ fi
|
||||
|
||||
if ! which java > /dev/null; then
|
||||
log "Fixing PATH to include java"
|
||||
PATH="${PATH}:/usr/bin"
|
||||
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||
fi
|
||||
|
||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
@@ -105,6 +98,12 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
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-deployForge "$@"
|
||||
;;
|
||||
|
||||
@@ -112,7 +111,17 @@ case "${TYPE^^}" in
|
||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||
;;
|
||||
|
||||
FTBA)
|
||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
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-deployCF "$@"
|
||||
;;
|
||||
|
||||
@@ -151,16 +160,20 @@ case "${TYPE^^}" in
|
||||
YATOPIA)
|
||||
exec ${SCRIPTS:-/}start-deployYatopia "$@"
|
||||
;;
|
||||
|
||||
AIRPLANE)
|
||||
|
||||
AIRPLANE)
|
||||
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
||||
;;
|
||||
|
||||
CANYON)
|
||||
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Invalid type: '$TYPE'"
|
||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE"
|
||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
||||
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ -z "$SERVER" ]]; then
|
||||
serverJar=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ -z "$serverJar" ]]; then
|
||||
|
||||
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
|
||||
@@ -89,15 +89,14 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
||||
fi
|
||||
|
||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
fi
|
||||
|
||||
export SERVER=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||
log "ERROR unable to locate installed forge server jar"
|
||||
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
||||
exit 2
|
||||
fi
|
||||
export SERVER
|
||||
|
||||
export FTB_DIR=$(dirname "${SERVER}")
|
||||
|
||||
@@ -110,6 +109,7 @@ entryScriptExpr="
|
||||
-o -name ServerStartLinux.sh
|
||||
-o -name LaunchServer.sh
|
||||
-o -name server-start.sh
|
||||
-o -name start-server.sh
|
||||
-o -name startserver.sh
|
||||
-o -name StartServer.sh
|
||||
"
|
||||
|
||||
54
start-deployCanyon
Normal file
54
start-deployCanyon
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
: ${CANYON_BUILD:=lastSuccessfulBuild}
|
||||
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
|
||||
|
||||
if [ "${JAVA_VER}" != "8" ]; then
|
||||
log "ERROR: Canyon server type only supports Java version 8"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" != "b1.7.3" ]; then
|
||||
log "ERROR: Canyon server type only supports VERSION=b1.7.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
canyonJob="https://ci.velocitypowered.com/job/Canyon"
|
||||
|
||||
buildRelPath=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.artifacts[0].relativePath'
|
||||
)
|
||||
buildNumber=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.number'
|
||||
)
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
|
||||
# Add build tag to non-tagged builds for version detection
|
||||
if [ ${baseName%.*} = 'canyon-server' ]; then
|
||||
export SERVER=${baseName%.*}_build${buildNumber}.jar
|
||||
else
|
||||
export SERVER="${baseName}"
|
||||
fi
|
||||
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
downloadUrl="${canyonJob}/${CANYON_BUILD}/artifact/${buildRelPath}"
|
||||
log "Downloading Canyon build ${buildNumber} from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
75
start-deployFTBA
Normal file
75
start-deployFTBA
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
ftbInstallMarker=".ftb-installed"
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
set -e
|
||||
|
||||
if ! [[ -v FTB_MODPACK_ID ]]; then
|
||||
log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ -v FTB_MODPACK_VERSION_ID ]]; then
|
||||
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
|
||||
log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
|
||||
exit 1
|
||||
fi
|
||||
elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_VERSION_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
|
||||
ftbInstaller=/data/ftb-installer
|
||||
if ! [[ -f "${ftbInstaller}" ]]; then
|
||||
log "Downloading FTB installer"
|
||||
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}"
|
||||
chmod +x "${ftbInstaller}"
|
||||
fi
|
||||
|
||||
rm -rf forge*jar mods config libraries defaultconfigs changelogs
|
||||
|
||||
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
|
||||
${ftbInstaller} ${FTB_MODPACK_ID} ${FTB_MODPACK_VERSION_ID} --noscript --auto
|
||||
rm -f forge*installer.jar
|
||||
|
||||
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
||||
|
||||
writeEula
|
||||
|
||||
# some modpacks result in --w----r-- permissions
|
||||
chmod a+r version.json
|
||||
else
|
||||
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
|
||||
fi
|
||||
|
||||
isDebugging && cat version.json
|
||||
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
|
||||
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
|
||||
|
||||
variants=(
|
||||
forge-${mcVersion}-${forgeVersion}.jar
|
||||
forge-${mcVersion}-${forgeVersion}-universal.jar
|
||||
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
|
||||
)
|
||||
for f in ${variants[@]}; do
|
||||
if [ -f $f ]; then
|
||||
export SERVER=$f
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ! [ -v SERVER ]; then
|
||||
log "ERROR unable to locate the installed forge server jar"
|
||||
ls *.jar
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
@@ -36,24 +36,28 @@ if [[ "$MODPACK" ]]; then
|
||||
log "ERROR: failed to download from $downloadUrl"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
elif [[ "$MODPACK" =~ .*\.zip ]]; then
|
||||
if ! cp $MODPACK /tmp/modpack.zip; then
|
||||
log "ERROR: failed to copy from $MODPACK"
|
||||
exit 2
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
|
||||
else
|
||||
log "ERROR Invalid URL given for MODPACK: $MODPACK"
|
||||
log "ERROR Invalid URL or Path given for MODPACK: $MODPACK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a plugin download it.
|
||||
@@ -87,8 +91,18 @@ if [[ "$MODS" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
elif [[ -f "$i" && "$i" =~ .*\.jar ]]; then
|
||||
log "Copying plugin located at $i ..."
|
||||
out_file=$(basename "$i")
|
||||
if ! cp "$i" "${out_dir}/$out_file"; then
|
||||
log "ERROR: failed to copy from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -d "$i" ]]; then
|
||||
log "Copying plugin jars from $i ..."
|
||||
cp "$i"/*.jar "${out_dir}"
|
||||
else
|
||||
log "ERROR Invalid URL given in MODS: $i"
|
||||
log "ERROR Invalid URL or path given in MODS: $i"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -177,6 +177,6 @@ eula=${EULA,,}
|
||||
|
||||
function removeOldMods {
|
||||
if [ -d "$1" ]; then
|
||||
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE:-}" -delete
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user