mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 07:26:24 +00:00
Compare commits
20 Commits
2021.17.0-
...
2021.7.0-j
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45856a1a81 | ||
|
|
1e615e76e8 | ||
|
|
1c85a685de | ||
|
|
7cd207f40b | ||
|
|
140a8aa90c | ||
|
|
76dcff9d18 | ||
|
|
a9a86d249b | ||
|
|
595760d301 | ||
|
|
6d3f194ce3 | ||
|
|
21c1620f0c | ||
|
|
e78e5af96d | ||
|
|
0fb9700fc7 | ||
|
|
18925ef32c | ||
|
|
f06b990f8a | ||
|
|
75844ae81a | ||
|
|
6bb2323c46 | ||
|
|
7814ca21b5 | ||
|
|
b8806629ec | ||
|
|
4a7f838a0f | ||
|
|
2d07dee4df |
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -1,7 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Maintain dependencies for GitHub Actions
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
86
.github/workflows/build-multiarch.yml
vendored
86
.github/workflows/build-multiarch.yml
vendored
@@ -2,58 +2,57 @@ name: Build and publish multiarch
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- multiarch
|
||||||
- "*-multiarch"
|
- java8-multiarch
|
||||||
- "multiarch*"
|
- multiarch-latest
|
||||||
- java8-openj9
|
- java15
|
||||||
- java11*
|
- java15-openj9
|
||||||
- java16*
|
|
||||||
- test/multiarch/*
|
- test/multiarch/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
|
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java11*"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java16*"
|
|
||||||
paths-ignore:
|
|
||||||
- "*.md"
|
|
||||||
- "docs/**"
|
|
||||||
- "examples/**"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-buildx:
|
docker-buildx:
|
||||||
if: github.repository == 'itzg/docker-minecraft-server'
|
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.2.0
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Prepare
|
||||||
id: meta
|
id: prep
|
||||||
uses: docker/metadata-action@v3
|
run: |
|
||||||
with:
|
DOCKER_IMAGE=itzg/minecraft-server
|
||||||
images: |
|
VERSION=edge
|
||||||
itzg/minecraft-server
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
tags: |
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
type=ref,event=branch
|
fi
|
||||||
type=ref,event=tag
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
flavor: |
|
VERSION=${GITHUB_REF#refs/heads/}
|
||||||
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
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: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.2.0
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
@@ -63,25 +62,22 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2.6.1
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
pull: true
|
pull: true
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
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 }}
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
||||||
- # Temp fix
|
|
||||||
# https://github.com/docker/build-push-action/issues/252
|
|
||||||
# https://github.com/moby/buildkit/issues/1896
|
|
||||||
name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
21
.github/workflows/generate-toc.yml
vendored
21
.github/workflows/generate-toc.yml
vendored
@@ -1,21 +0,0 @@
|
|||||||
name: Generate README table of contents
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- README.md
|
|
||||||
jobs:
|
|
||||||
generate:
|
|
||||||
if: github.repository == 'itzg/docker-minecraft-server'
|
|
||||||
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: "docs: Auto update markdown TOC"
|
|
||||||
25
.github/workflows/main.yml
vendored
25
.github/workflows/main.yml
vendored
@@ -3,12 +3,14 @@ name: Build and Publish
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- master
|
||||||
- java8
|
- java8
|
||||||
- openj9
|
- openj9
|
||||||
- openj9-11
|
- openj9-11
|
||||||
- adopt11
|
- adopt11
|
||||||
- test/*
|
- test/*
|
||||||
tags:
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[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"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||||
@@ -20,7 +22,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
@@ -49,17 +51,20 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||||
echo ::set-output name=tags::${TAGS}
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=cache_from::${TAGS}
|
||||||
echo ::set-output name=version::${VERSION//\//-}
|
echo ::set-output name=version::${VERSION//\//-}
|
||||||
|
echo ::set-output name=cache_version::${VERSION//\//-}
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
@@ -70,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2.6.1
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -81,7 +86,7 @@ jobs:
|
|||||||
# tags determined by prep step
|
# tags determined by prep step
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||||
@@ -90,11 +95,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
||||||
- # Temp fix
|
|
||||||
# https://github.com/docker/build-push-action/issues/252
|
|
||||||
# https://github.com/moby/buildkit/issues/1896
|
|
||||||
name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
||||||
|
|||||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
/data/
|
/data/
|
||||||
/.idea/
|
/.idea/
|
||||||
*.iml
|
*.iml
|
||||||
/gh-md-toc
|
|
||||||
11
BUILDING.md
11
BUILDING.md
@@ -1,11 +0,0 @@
|
|||||||
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 .
|
|
||||||
```
|
|
||||||
58
Dockerfile
58
Dockerfile
@@ -1,29 +1,32 @@
|
|||||||
FROM adoptopenjdk:16-jre
|
FROM openjdk:8u212-jre-alpine
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
RUN apt-get update \
|
# upgrade all packages since alpine jre8 base image tops out at 8u212
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
RUN apk -U --no-cache upgrade
|
||||||
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 --gid 1000 minecraft \
|
RUN apk add --no-cache -U \
|
||||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
openssl \
|
||||||
|
imagemagick \
|
||||||
|
lsof \
|
||||||
|
su-exec \
|
||||||
|
shadow \
|
||||||
|
bash \
|
||||||
|
curl iputils wget \
|
||||||
|
git \
|
||||||
|
jq \
|
||||||
|
mysql-client \
|
||||||
|
tzdata \
|
||||||
|
rsync \
|
||||||
|
nano \
|
||||||
|
sudo \
|
||||||
|
knock \
|
||||||
|
ttf-dejavu
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
COPY files/sudoers* /etc/sudoers.d
|
COPY files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -31,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
|
||||||
@@ -66,10 +69,8 @@ COPY server.properties /tmp/server.properties
|
|||||||
COPY log4j2.xml /tmp/log4j2.xml
|
COPY log4j2.xml /tmp/log4j2.xml
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
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 \
|
||||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
@@ -84,6 +85,5 @@ RUN dos2unix /start* && chmod +x /start*
|
|||||||
RUN dos2unix /health.sh && chmod +x /health.sh
|
RUN dos2unix /health.sh && chmod +x /health.sh
|
||||||
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/start" ]
|
ENTRYPOINT [ "/start" ]
|
||||||
HEALTHCHECK --start-period=1m CMD /health.sh
|
HEALTHCHECK --start-period=1m CMD /health.sh
|
||||||
|
|||||||
787
README.md
787
README.md
@@ -38,117 +38,6 @@ 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.
|
> 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)
|
|
||||||
* [Using Docker Compose](#using-docker-compose)
|
|
||||||
* [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)
|
|
||||||
* [Working with mods and plugins](#working-with-mods-and-plugins)
|
|
||||||
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
|
|
||||||
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
|
|
||||||
* [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)
|
|
||||||
* [Working with world data](#working-with-world-data)
|
|
||||||
* [Downloadable world](#downloadable-world)
|
|
||||||
* [Cloning world from a container path](#cloning-world-from-a-container-path)
|
|
||||||
* [Overwrite world on start](#overwrite-world-on-start)
|
|
||||||
* [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)
|
|
||||||
* [Level / World Save Name](#level--world-save-name)
|
|
||||||
* [Online mode](#online-mode)
|
|
||||||
* [Allow flight](#allow-flight)
|
|
||||||
* [Other server property mappings](#other-server-property-mappings)
|
|
||||||
* [Miscellaneous Options](#miscellaneous-options)
|
|
||||||
* [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)
|
|
||||||
* [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 Jul 15 13:34:00 UTC 2021 -->
|
|
||||||
|
|
||||||
<!--te-->
|
|
||||||
|
|
||||||
## Looking for a Bedrock Dedicated Server
|
## Looking for a Bedrock Dedicated Server
|
||||||
|
|
||||||
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
||||||
@@ -221,9 +110,6 @@ services:
|
|||||||
- 25565:25565
|
- 25565:25565
|
||||||
environment:
|
environment:
|
||||||
EULA: "TRUE"
|
EULA: "TRUE"
|
||||||
tty: true
|
|
||||||
stdin_open: true
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
# attach a directory relative to the directory containing this compose file
|
# attach a directory relative to the directory containing this compose file
|
||||||
- ./minecraft-data:/data
|
- ./minecraft-data:/data
|
||||||
@@ -252,7 +138,7 @@ docker run -d -it --name mc-new -v mc:/data -p 25565:25565 -e EULA=TRUE -e MEMOR
|
|||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
To use a different Minecraft version, pass the `VERSION` environment variable (case sensitive), which can have the value
|
To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value
|
||||||
|
|
||||||
- LATEST (the default)
|
- LATEST (the default)
|
||||||
- SNAPSHOT
|
- SNAPSHOT
|
||||||
@@ -277,14 +163,15 @@ To use a different version of Java, please use a docker tag to run your Minecraf
|
|||||||
|
|
||||||
| Tag name | Java version | Linux | JVM Type | Architecture |
|
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||||
| -------------- | -------------|--------|----------|-------------------|
|
| -------------- | -------------|--------|----------|-------------------|
|
||||||
| latest | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
| latest | 11 | Alpine | Hotspot | amd64 |
|
||||||
| 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 |
|
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| java11 | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
| java15-openj9 | 15 | Debian | OpenJ9 | amd64,arm64 |
|
||||||
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
| adopt11 | 11 | Alpine | Hotspot | amd64 |
|
||||||
| java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
| openj9 | 8 | Alpine | OpenJ9 | amd64 |
|
||||||
| java16-openj9 | 16 | Debian | OpenJ9 | amd64 |
|
| openj9-11 | 11 | Alpine | OpenJ9 | amd64 |
|
||||||
|
| multiarch | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
|
|
||||||
For example, to use Java version 15 on any supported architecture:
|
For example, to use Java version 15 on any supported architecture:
|
||||||
@@ -325,9 +212,7 @@ Some orchestration systems, such as Portainer, don't allow for disabling the def
|
|||||||
|
|
||||||
### Helm Charts
|
### Helm Charts
|
||||||
|
|
||||||
- itzg Helm Chart:
|
- [stable/minecraft](https://hub.helm.sh/charts/stable/minecraft) ([chart source](https://github.com/helm/charts/tree/master/stable/minecraft))
|
||||||
- [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)
|
- [mcsh/server-deployment](https://github.com/mcserverhosting-net/charts)
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@@ -338,44 +223,13 @@ 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.
|
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.
|
||||||
|
|
||||||
### Using Docker Compose
|
## Running a Forge Server
|
||||||
|
|
||||||
Rather than type the server options below, the port mappings above, etc
|
|
||||||
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"
|
|
||||||
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
ports:
|
|
||||||
- 25565:25565
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
tty: true
|
|
||||||
stdin_open: true
|
|
||||||
restart: unless-stopped
|
|
||||||
```
|
|
||||||
|
|
||||||
and in the same directory as that file run
|
|
||||||
|
|
||||||
docker-compose up -d
|
|
||||||
|
|
||||||
Now, go play...or adjust the `environment` section to configure
|
|
||||||
this server instance.
|
|
||||||
|
|
||||||
## 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.
|
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`.
|
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 TYPE=FORGE \
|
||||||
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
|
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
@@ -383,18 +237,36 @@ 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
|
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:
|
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 ...
|
-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
|
To download a Forge installer from a custom location, such as your own file repository, specify
|
||||||
the URL with `FORGE_INSTALLER_URL`, such as:
|
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 ...
|
-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.
|
In both of the cases above, there is no need for the `VERSION` or `FORGEVERSION` variables.
|
||||||
|
|
||||||
### Running a Bukkit/Spigot server
|
### 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 `/config` by setting the `COPY_CONFIG_DEST` variable, where the default is `/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
|
||||||
|
|
||||||
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
|
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
|
||||||
|
|
||||||
@@ -415,7 +287,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.
|
> 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.
|
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
|
||||||
|
|
||||||
@@ -437,7 +309,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)
|
[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.
|
A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of Paper aimed at improving server performance at high playercounts.
|
||||||
|
|
||||||
@@ -445,22 +317,9 @@ A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of P
|
|||||||
|
|
||||||
> **NOTE** only `VERSION=LATEST` is supported
|
> **NOTE** only `VERSION=LATEST` is supported
|
||||||
|
|
||||||
### Running an Airplane server
|
## Running a Purpur server
|
||||||
|
|
||||||
An [Airplane](https://github.com/TECHNOVE/Airplane) server, which is a fork of Tuinity aimed at further improving server performance at high playercounts.
|
A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper and Tuinity with the goal of providing new and interesting configuration options".
|
||||||
|
|
||||||
-e TYPE=AIRPLANE
|
|
||||||
|
|
||||||
> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.17" "1.16" "PURPUR" and "PURPUR-1.16"
|
|
||||||
|
|
||||||
Extra variables:
|
|
||||||
- `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use
|
|
||||||
- `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
|
|
||||||
|
|
||||||
A [Purpur](https://purpur.pl3x.net/) server, which is "a drop-in replacement for Paper servers designed for configurability, new fun and exciting gameplay features, and high performance built on top of Tuinity."
|
|
||||||
|
|
||||||
-e TYPE=PURPUR
|
-e TYPE=PURPUR
|
||||||
|
|
||||||
@@ -470,7 +329,7 @@ Extra variables:
|
|||||||
- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use
|
- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use
|
||||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||||
|
|
||||||
### 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".
|
A [Yatopia](https://github.com/YatopiaMC/Yatopia) server, which is a "blazing fast Tuinity fork with best in class performance".
|
||||||
|
|
||||||
@@ -481,9 +340,8 @@ A [Yatopia](https://github.com/YatopiaMC/Yatopia) server, which is a "blazing fa
|
|||||||
Extra variables:
|
Extra variables:
|
||||||
- `RELEASE=stable` : set to `stable` or `latest`
|
- `RELEASE=stable` : set to `stable` or `latest`
|
||||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
- `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
|
A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with
|
||||||
|
|
||||||
@@ -492,9 +350,9 @@ 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"
|
> **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/MohistMC/Mohist) server can be used with
|
A [Mohist](https://github.com/Mohist-Community/Mohist) server can be used with
|
||||||
|
|
||||||
-e TYPE=MOHIST
|
-e TYPE=MOHIST
|
||||||
|
|
||||||
@@ -504,7 +362,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
|
-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
|
A [Catserver](http://catserver.moe/) type server can be used with
|
||||||
|
|
||||||
@@ -512,63 +370,6 @@ A [Catserver](http://catserver.moe/) type server can be used with
|
|||||||
|
|
||||||
> **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored
|
> **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
|
## 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).
|
> **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version).
|
||||||
@@ -640,32 +441,96 @@ then you apply a workaround by adding this to the run invocation:
|
|||||||
|
|
||||||
-e FTB_LEGACYJAVAFIXER=true
|
-e FTB_LEGACYJAVAFIXER=true
|
||||||
|
|
||||||
## Working with mods and plugins
|
## Running a SpongeVanilla server
|
||||||
|
|
||||||
### Optional plugins, mods, and config attach points
|
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.
|
||||||
|
|
||||||
There are optional volume paths that can be attached to supply content to be copied into the data area:
|
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
|
||||||
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
|
||||||
`/plugins`
|
You can also choose to use the `EXPERIMENTAL` branch.
|
||||||
: contents are copied into `/data/plugins` for Bukkit related server types. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
Just change it with `SPONGEBRANCH`, such as:
|
||||||
|
|
||||||
`/mods`
|
$ docker run -d -v /path/on/host:/data ... \
|
||||||
: contents are copied into `/data/mods` for Forge related server types
|
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
|
||||||
|
|
||||||
`/config`
|
## Running a Fabric Server
|
||||||
: 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.
|
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`.
|
||||||
|
|
||||||
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.
|
```
|
||||||
|
docker run -d -v /path/on/host:/data \
|
||||||
|
-e TYPE=FABRIC \
|
||||||
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
```
|
||||||
|
|
||||||
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.
|
A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`.
|
||||||
|
|
||||||
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.
|
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:
|
||||||
|
|
||||||
> 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)
|
```
|
||||||
|
docker run -d -v /path/on/host:/data ... \
|
||||||
|
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||||
|
```
|
||||||
|
|
||||||
### Auto-downloading SpigotMC/Bukkit/PaperMC plugins
|
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
|
||||||
|
|
||||||
|
### Using separate mounts
|
||||||
|
|
||||||
|
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||||
|
or downloading a world with the `WORLD` option.
|
||||||
|
|
||||||
|
There are two additional volumes that can be mounted; `/mods` and `/config`.
|
||||||
|
Any files in either of these filesystems will be copied over to the main
|
||||||
|
`/data` filesystem before starting Minecraft.
|
||||||
|
|
||||||
|
This works 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.
|
||||||
|
|
||||||
|
## Deploying plugins from attached volume
|
||||||
|
|
||||||
|
If the `/plugins` directory exists in the container, such as from an attached volume, any files in this directory will be copied over to `/data/plugins` before starting Minecraft. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||||
|
|
||||||
|
This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
|
## 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.
|
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.
|
||||||
|
|
||||||
@@ -680,65 +545,157 @@ For example, the following will auto-download the [EssentialsX](https://www.spig
|
|||||||
|
|
||||||
-e SPIGET_RESOURCES=9089,34315
|
-e SPIGET_RESOURCES=9089,34315
|
||||||
|
|
||||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
## Replacing variables inside configs
|
||||||
|
|
||||||
Like the `WORLD` option above, you can specify the URL or path of a "mod pack"
|
Sometimes you have mods or plugins that require configuration information that is only available at runtime.
|
||||||
to download and install into `mods` for Forge or `plugins` for Bukkit/Spigot.
|
For example if you need to configure a plugin to connect to a database,
|
||||||
To use this option pass the environment variable `MODPACK`, such as
|
you don't want to include this information in your Git repository or Docker image.
|
||||||
|
Or maybe you have some runtime information like the server name that needs to be set
|
||||||
|
in your config files after the container starts.
|
||||||
|
|
||||||
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
For those cases there is the option to replace defined variables inside your configs
|
||||||
|
with environment variables defined at container runtime.
|
||||||
|
|
||||||
**NOTE:** The referenced URL must be a zip file with one or more jar files at the
|
If you set the enviroment variable `REPLACE_ENV_VARIABLES` to `TRUE` the startup script
|
||||||
top level of the zip archive. Make sure the jars are compatible with the
|
will go thru all files inside your `/data` volume and replace variables that match your
|
||||||
particular `TYPE` of server you are running.
|
defined environment variables. Variables that you want to replace need to be wrapped
|
||||||
|
inside `${YOUR_VARIABLE}` curly brackets and prefixed with a dollar sign. This is the regular
|
||||||
|
syntax for enviromment variables inside strings or config files.
|
||||||
|
|
||||||
You may also download or copy over individual mods using the `MODS` environment variable. `MODS` contains a comma-separated list of
|
Optionally you can also define a prefix to only match predefined environment variables.
|
||||||
- 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,/plugins/common,/plugins/special/mod2.jar ...
|
`ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix
|
||||||
|
|
||||||
### Remove old mods/plugins
|
If you want use file for value (like when use secrets) you can add suffix `_FILE` to your variable name (in run command).
|
||||||
|
|
||||||
When the option above is specified (`MODPACK`) you can also instruct script to
|
There are some limitations to what characters you can use.
|
||||||
delete old mods/plugins prior to installing new ones. This behaviour is desirable
|
|
||||||
in case you want to upgrade mods/plugins from downloaded zip file.
|
|
||||||
To use this option pass the environment variable `REMOVE_OLD_MODS="TRUE"`, such as
|
|
||||||
|
|
||||||
docker run -d -e REMOVE_OLD_MODS="TRUE" -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
| Type | Allowed Characters |
|
||||||
|
| ----- | ------------------- |
|
||||||
|
| Name | `0-9a-zA-Z_-` |
|
||||||
|
| Value | `0-9a-zA-Z_-:/=?.+` |
|
||||||
|
|
||||||
**WARNING:** All content of the `mods` or `plugins` directory will be deleted
|
Variables will be replaced in files with the following extensions:
|
||||||
before unpacking new content from the MODPACK or MODS.
|
`.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`.
|
||||||
|
|
||||||
## Working with world data
|
Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`.
|
||||||
|
|
||||||
### Downloadable world
|
|
||||||
|
|
||||||
Instead of mounting the `/data` volume, you can instead specify the URL of a ZIP file containing an archived world. It will be searched for a file `level.dat` and the containing subdirectory moved to the directory named by `$LEVEL`. This means that most of the archived Minecraft worlds downloadable from the Internet will already be in the correct format.
|
|
||||||
|
|
||||||
docker run -d -e WORLD=http://www.example.com/worlds/MySave.zip ...
|
|
||||||
|
|
||||||
**NOTE:** This URL must be accessible from inside the container. Therefore,
|
|
||||||
you should use an IP address or a globally resolvable FQDN, or else the
|
|
||||||
name of a linked container.
|
|
||||||
|
|
||||||
**NOTE:** If the archive contains more than one `level.dat`, then the one to select can be picked with `WORLD_INDEX`, which defaults to 1.
|
|
||||||
|
|
||||||
### Cloning world from a container path
|
|
||||||
|
|
||||||
The `WORLD` option can also be used to reference a directory or zip file that will be used as a source to clone or unzip the world directory.
|
|
||||||
|
|
||||||
For example, the following would initially clone the world's content
|
|
||||||
from `/worlds/basic`. Also notice in the example that you can use a
|
|
||||||
read-only volume attachment to ensure the clone source remains pristine.
|
|
||||||
|
|
||||||
|
Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. Path
|
||||||
|
excludes are recursive. Here is an example:
|
||||||
```
|
```
|
||||||
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
REPLACE_ENV_VARIABLES_EXCLUDE_PATHS="/data/plugins/Essentials/userdata /data/plugins/MyPlugin"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Overwrite world on start
|
Here is a full example where we want to replace values inside a `database.yml`.
|
||||||
The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start.
|
|
||||||
|
```yml
|
||||||
|
|
||||||
|
---
|
||||||
|
database:
|
||||||
|
host: ${CFG_DB_HOST}
|
||||||
|
name: ${CFG_DB_NAME}
|
||||||
|
password: ${CFG_DB_PASSWORD}
|
||||||
|
```
|
||||||
|
|
||||||
|
This is how your `docker-compose.yml` file could look like:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
# Other docker-compose examples in /examples
|
||||||
|
|
||||||
|
services:
|
||||||
|
minecraft:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
volumes:
|
||||||
|
- "mc:/data"
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
ENABLE_RCON: "true"
|
||||||
|
RCON_PASSWORD: "testing"
|
||||||
|
RCON_PORT: 28016
|
||||||
|
# enable env variable replacement
|
||||||
|
REPLACE_ENV_VARIABLES: "TRUE"
|
||||||
|
# define an optional prefix for your env variables you want to replace
|
||||||
|
ENV_VARIABLE_PREFIX: "CFG_"
|
||||||
|
# and here are the actual variables
|
||||||
|
CFG_DB_HOST: "http://localhost:3306"
|
||||||
|
CFG_DB_NAME: "minecraft"
|
||||||
|
CFG_DB_PASSWORD_FILE: "/run/secrets/db_password"
|
||||||
|
restart: always
|
||||||
|
rcon:
|
||||||
|
image: itzg/rcon
|
||||||
|
ports:
|
||||||
|
- "4326:4326"
|
||||||
|
- "4327:4327"
|
||||||
|
volumes:
|
||||||
|
- "rcon:/opt/rcon-web-admin/db"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mc:
|
||||||
|
rcon:
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
db_password:
|
||||||
|
file: ./db_password
|
||||||
|
```
|
||||||
|
|
||||||
|
The content of `db_password`:
|
||||||
|
|
||||||
|
ug23u3bg39o-ogADSs
|
||||||
|
|
||||||
|
## Running with a custom server JAR
|
||||||
|
|
||||||
|
If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server
|
||||||
|
JAR via `CUSTOM_SERVER`. It can either be a URL or a container path to an existing JAR file.
|
||||||
|
|
||||||
|
If it is a URL, it will only be downloaded into the `/data` directory if it wasn't already. As
|
||||||
|
such, if you need to upgrade or re-download the JAR, then you will need to stop the container,
|
||||||
|
remove the file from the container's `/data` directory, and start again.
|
||||||
|
|
||||||
|
## Force re-download of the server file
|
||||||
|
|
||||||
|
For VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, CURSEFORGE, SPONGEVANILLA server types, set
|
||||||
|
`$FORCE_REDOWNLOAD` to some value (e.g. 'true) to force a re-download of the server file for
|
||||||
|
the particular server type. by adding a `-e FORCE_REDOWNLOAD=true` to your command-line.
|
||||||
|
|
||||||
|
For example, with PaperSpigot, it would look something like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d -v /path/on/host:/data \
|
||||||
|
-e TYPE=PAPER -e FORCE_REDOWNLOAD=true \
|
||||||
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using Docker Compose
|
||||||
|
|
||||||
|
Rather than type the server options below, the port mappings above, etc
|
||||||
|
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:
|
||||||
|
|
||||||
|
```
|
||||||
|
minecraft-server:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
|
||||||
|
tty: true
|
||||||
|
stdin_open: true
|
||||||
|
restart: always
|
||||||
|
```
|
||||||
|
|
||||||
|
and in the same directory as that file run
|
||||||
|
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
Now, go play...or adjust the `environment` section to configure
|
||||||
|
this server instance.
|
||||||
|
|
||||||
## Server configuration
|
## Server configuration
|
||||||
|
|
||||||
@@ -789,11 +746,10 @@ To whitelist players for your Minecraft server, pass the Minecraft usernames sep
|
|||||||
|
|
||||||
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
|
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
|
||||||
|
|
||||||
> NOTE: When `WHITELIST` is used the server properties `white-list` and `whitelist` will automatically get set to `true`.
|
> NOTE: When `WHITELIST` is used the server property `white-list` will automatically get set to `true`.
|
||||||
|
|
||||||
> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup.
|
> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup.
|
||||||
|
|
||||||
Alternatively, you can set `ENABLE_WHITELIST=true` to only set the server properties `white-list` and `whitelist` without modifying the whitelist file. In this case the whitelist is solely managed using the `whitelist add` and `whitelist remove` commands.
|
|
||||||
### Op/Administrator Players
|
### Op/Administrator Players
|
||||||
|
|
||||||
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
||||||
@@ -1009,17 +965,71 @@ You can set a link to a custom resource pack and set it's checksum using the `RE
|
|||||||
|
|
||||||
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
|
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
|
||||||
|
|
||||||
### Level / World Save Name
|
### World Save Name
|
||||||
|
|
||||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
||||||
where the default is "world":
|
where the default is "world":
|
||||||
|
|
||||||
docker run -d -e LEVEL=bonus ...
|
docker run -d -e LEVEL=bonus ...
|
||||||
|
|
||||||
> **NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
|
**NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
|
||||||
`LEVEL` in use or don't use `-v` and the container's filesystem will keep things encapsulated.
|
`LEVEL` in use or don't use `-v` and the container's filesystem will keep things encapsulated.
|
||||||
|
|
||||||
> **INFO** Refer to the [data directory](#data-directory) section for a visual description of where the `$LEVEL` directory is situated.
|
### Downloadable world
|
||||||
|
|
||||||
|
Instead of mounting the `/data` volume, you can instead specify the URL of a ZIP file containing an archived world. It will be searched for a file `level.dat` and the containing subdirectory moved to the directory named by `$LEVEL`. This means that most of the archived Minecraft worlds downloadable from the Internet will already be in the correct format.
|
||||||
|
|
||||||
|
docker run -d -e WORLD=http://www.example.com/worlds/MySave.zip ...
|
||||||
|
|
||||||
|
**NOTE:** This URL must be accessible from inside the container. Therefore,
|
||||||
|
you should use an IP address or a globally resolvable FQDN, or else the
|
||||||
|
name of a linked container.
|
||||||
|
|
||||||
|
**NOTE:** If the archive contains more than one `level.dat`, then the one to select can be picked with `WORLD_INDEX`, which defaults to 1.
|
||||||
|
|
||||||
|
### Cloning world from a container path
|
||||||
|
|
||||||
|
The `WORLD` option can also be used to reference a directory or zip file that will be used as a source to clone or unzip the world directory.
|
||||||
|
|
||||||
|
For example, the following would initially clone the world's content
|
||||||
|
from `/worlds/basic`. Also notice in the example that you can use a
|
||||||
|
read-only volume attachment to ensure the clone source remains pristine.
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
||||||
|
```
|
||||||
|
|
||||||
|
### Overwrite world on start
|
||||||
|
The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start.
|
||||||
|
|
||||||
|
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||||
|
|
||||||
|
Like the `WORLD` option above, you can specify the URL 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
|
||||||
|
|
||||||
|
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||||
|
|
||||||
|
**NOTE:** The referenced URL must be a zip file with one or more jar files at the
|
||||||
|
top level of the zip archive. Make sure the jars are compatible with the
|
||||||
|
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.
|
||||||
|
|
||||||
|
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,https://www.example.com/mods/mod2.jar ...
|
||||||
|
|
||||||
|
### Remove old mods/plugins
|
||||||
|
|
||||||
|
When the option above is specified (`MODPACK`) you can also instruct script to
|
||||||
|
delete old mods/plugins prior to installing new ones. This behaviour is desirable
|
||||||
|
in case you want to upgrade mods/plugins from downloaded zip file.
|
||||||
|
To use this option pass the environment variable `REMOVE_OLD_MODS="TRUE"`, such as
|
||||||
|
|
||||||
|
docker run -d -e REMOVE_OLD_MODS="TRUE" -e MODPACK=http://www.example.com/mods/modpack.zip ...
|
||||||
|
|
||||||
|
**WARNING:** All content of the `mods` or `plugins` directory will be deleted
|
||||||
|
before unpacking new content from the MODPACK or MODS.
|
||||||
|
|
||||||
### Online mode
|
### Online mode
|
||||||
|
|
||||||
@@ -1050,133 +1060,9 @@ Allows users to use flight on your server while in Survival mode, if they have a
|
|||||||
| PREVENT_PROXY_CONNECTIONS | prevent-proxy-connections |
|
| PREVENT_PROXY_CONNECTIONS | prevent-proxy-connections |
|
||||||
| USE_NATIVE_TRANSPORT | use-native-transport |
|
| USE_NATIVE_TRANSPORT | use-native-transport |
|
||||||
| ENFORCE_WHITELIST | enforce-whitelist |
|
| ENFORCE_WHITELIST | enforce-whitelist |
|
||||||
| ENABLE_WHITELIST | white-list and whitelist |
|
|
||||||
|
|
||||||
## Miscellaneous Options
|
## Miscellaneous Options
|
||||||
|
|
||||||
### Replacing variables inside configs
|
|
||||||
|
|
||||||
Sometimes you have mods or plugins that require configuration information that is only available at runtime.
|
|
||||||
For example if you need to configure a plugin to connect to a database,
|
|
||||||
you don't want to include this information in your Git repository or Docker image.
|
|
||||||
Or maybe you have some runtime information like the server name that needs to be set
|
|
||||||
in your config files after the container starts.
|
|
||||||
|
|
||||||
For those cases there is the option to replace defined variables inside your configs
|
|
||||||
with environment variables defined at container runtime.
|
|
||||||
|
|
||||||
If you set the enviroment variable `REPLACE_ENV_VARIABLES` to `TRUE` the startup script
|
|
||||||
will go thru all files inside your `/data` volume and replace variables that match your
|
|
||||||
defined environment variables. Variables that you want to replace need to be wrapped
|
|
||||||
inside `${YOUR_VARIABLE}` curly brackets and prefixed with a dollar sign. This is the regular
|
|
||||||
syntax for enviromment variables inside strings or config files.
|
|
||||||
|
|
||||||
Optionally you can also define a prefix to only match predefined environment variables.
|
|
||||||
|
|
||||||
`ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix
|
|
||||||
|
|
||||||
If you want use file for value (like when use secrets) you can add suffix `_FILE` to your variable name (in run command).
|
|
||||||
|
|
||||||
There are some limitations to what characters you can use.
|
|
||||||
|
|
||||||
| Type | Allowed Characters |
|
|
||||||
| ----- | ------------------- |
|
|
||||||
| Name | `0-9a-zA-Z_-` |
|
|
||||||
| Value | `0-9a-zA-Z_-:/=?.+` |
|
|
||||||
|
|
||||||
Variables will be replaced in files with the following extensions:
|
|
||||||
`.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`.
|
|
||||||
|
|
||||||
Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`.
|
|
||||||
|
|
||||||
Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. Path
|
|
||||||
excludes are recursive. Here is an example:
|
|
||||||
```
|
|
||||||
REPLACE_ENV_VARIABLES_EXCLUDE_PATHS="/data/plugins/Essentials/userdata /data/plugins/MyPlugin"
|
|
||||||
```
|
|
||||||
|
|
||||||
Here is a full example where we want to replace values inside a `database.yml`.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
|
|
||||||
---
|
|
||||||
database:
|
|
||||||
host: ${CFG_DB_HOST}
|
|
||||||
name: ${CFG_DB_NAME}
|
|
||||||
password: ${CFG_DB_PASSWORD}
|
|
||||||
```
|
|
||||||
|
|
||||||
This is how your `docker-compose.yml` file could look like:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
version: "3.8"
|
|
||||||
# Other docker-compose examples in /examples
|
|
||||||
|
|
||||||
services:
|
|
||||||
minecraft:
|
|
||||||
image: itzg/minecraft-server
|
|
||||||
ports:
|
|
||||||
- "25565:25565"
|
|
||||||
volumes:
|
|
||||||
- "mc:/data"
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
ENABLE_RCON: "true"
|
|
||||||
RCON_PASSWORD: "testing"
|
|
||||||
RCON_PORT: 28016
|
|
||||||
# enable env variable replacement
|
|
||||||
REPLACE_ENV_VARIABLES: "TRUE"
|
|
||||||
# define an optional prefix for your env variables you want to replace
|
|
||||||
ENV_VARIABLE_PREFIX: "CFG_"
|
|
||||||
# and here are the actual variables
|
|
||||||
CFG_DB_HOST: "http://localhost:3306"
|
|
||||||
CFG_DB_NAME: "minecraft"
|
|
||||||
CFG_DB_PASSWORD_FILE: "/run/secrets/db_password"
|
|
||||||
restart: always
|
|
||||||
rcon:
|
|
||||||
image: itzg/rcon
|
|
||||||
ports:
|
|
||||||
- "4326:4326"
|
|
||||||
- "4327:4327"
|
|
||||||
volumes:
|
|
||||||
- "rcon:/opt/rcon-web-admin/db"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mc:
|
|
||||||
rcon:
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
db_password:
|
|
||||||
file: ./db_password
|
|
||||||
```
|
|
||||||
|
|
||||||
The content of `db_password`:
|
|
||||||
|
|
||||||
ug23u3bg39o-ogADSs
|
|
||||||
|
|
||||||
### Running with a custom server JAR
|
|
||||||
|
|
||||||
If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server
|
|
||||||
JAR via `CUSTOM_SERVER`. It can either be a URL or a container path to an existing JAR file.
|
|
||||||
|
|
||||||
If it is a URL, it will only be downloaded into the `/data` directory if it wasn't already. As
|
|
||||||
such, if you need to upgrade or re-download the JAR, then you will need to stop the container,
|
|
||||||
remove the file from the container's `/data` directory, and start again.
|
|
||||||
|
|
||||||
### Force re-download of the server file
|
|
||||||
|
|
||||||
For VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, CURSEFORGE, SPONGEVANILLA server types, set
|
|
||||||
`$FORCE_REDOWNLOAD` to some value (e.g. 'true) to force a re-download of the server file for
|
|
||||||
the particular server type. by adding a `-e FORCE_REDOWNLOAD=true` to your command-line.
|
|
||||||
|
|
||||||
For example, with PaperSpigot, it would look something like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run -d -v /path/on/host:/data \
|
|
||||||
-e TYPE=PAPER -e FORCE_REDOWNLOAD=true \
|
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running as alternate user/group ID
|
### Running as alternate user/group ID
|
||||||
|
|
||||||
By default, the container will switch to user ID 1000 and group ID 1000;
|
By default, the container will switch to user ID 1000 and group ID 1000;
|
||||||
@@ -1211,41 +1097,6 @@ via a `JVM_XX_OPTS` environment variable.
|
|||||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||||
|
|
||||||
### Interactive and Color Console
|
|
||||||
|
|
||||||
If you would like to `docker attach` to the Minecraft server console with color and interactive capabilities, then add
|
|
||||||
|
|
||||||
```
|
|
||||||
-e EXEC_DIRECTLY=true
|
|
||||||
```
|
|
||||||
|
|
||||||
> **NOTES**
|
|
||||||
>
|
|
||||||
> This feature doesn't work via rcon, so you will need to `docker attach` to the container. Use the sequence Ctrl-P, Ctrl-Q to detach.
|
|
||||||
>
|
|
||||||
> This will bypass graceful server shutdown handling when using `docker stop`, so be sure the server console's `stop` command.
|
|
||||||
>
|
|
||||||
> Make to enable stdin and tty with `-it` when using `docker run` or `stdin_open: true` and `tty: true` when using docker compose.
|
|
||||||
|
|
||||||
### OpenJ9 Specific Options
|
|
||||||
|
|
||||||
The openj9 image tags include specific variables to simplify configuration:
|
|
||||||
|
|
||||||
- `-e TUNE_VIRTUALIZED=TRUE` : enables the option to
|
|
||||||
[optimize for virtualized environments](https://www.eclipse.org/openj9/docs/xtunevirtualized/)
|
|
||||||
- `-e TUNE_NURSERY_SIZES=TRUE` : configures nursery sizes where the initial size is 50%
|
|
||||||
of the `MAX_MEMORY` and the max size is 80%.
|
|
||||||
|
|
||||||
### Enabling rolling logs
|
|
||||||
|
|
||||||
By default the vanilla log file will grow without limit. The logger can be reconfigured to use a rolling log files strategy by using:
|
|
||||||
|
|
||||||
```
|
|
||||||
-e ENABLE_ROLLING_LOGS=true
|
|
||||||
```
|
|
||||||
|
|
||||||
> **NOTE** this will interfere with interactive/color consoles [as described in the section above](#interactive-and-color-console)
|
|
||||||
|
|
||||||
## Timezone Configuration
|
## Timezone Configuration
|
||||||
|
|
||||||
You can configure the timezone to match yours by setting the `TZ` environment variable:
|
You can configure the timezone to match yours by setting the `TZ` environment variable:
|
||||||
@@ -1303,7 +1154,7 @@ disable that by passing `-e GUI=FALSE`.
|
|||||||
|
|
||||||
### Stop Duration
|
### Stop Duration
|
||||||
|
|
||||||
When the container is signalled to stop, the Minecraft process wrapper will attempt to send a "stop" command via RCON or console and waits for the process to gracefully finish. By default it waits 60 seconds, but that duration can be configured by setting the environment variable `STOP_DURATION` to the number of seconds.
|
When the container is signalled to stop, the Minecraft process wrapper will attempt to send a "stop" command via RCON or console and waits for the process to gracefully finish. By defaul it waits 60 seconds, but that duration can be configured by setting the environment variable `STOP_DURATION` to the number of seconds.
|
||||||
|
|
||||||
## Autopause
|
## Autopause
|
||||||
|
|
||||||
@@ -1317,7 +1168,7 @@ Of course, even loaded chunks are not ticked when the process is stopped.
|
|||||||
|
|
||||||
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](#max-tick-time).
|
**You must greatly increase or disable max-tick-time watchdog functionality.** From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set to a very large value or -1 to disable it entirely, which is highly recommended. That can be set with `MAX_TICK_TIME` as described in [the section below](#max-tick-time).
|
||||||
|
|
||||||
> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately. For PaperMC servers, you need to send the JVM flag `-Ddisable.watchdog=true`, this can be done with the docker env variable `-e JVM_DD_OPTS=disable.watchdog:true`
|
> **NOTE:** Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately (e.g. PAPER Servers).
|
||||||
|
|
||||||
On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled.
|
On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled.
|
||||||
|
|
||||||
@@ -1347,7 +1198,9 @@ The following environment variables define the behaviour of auto-pausing:
|
|||||||
|
|
||||||
## Running on RaspberryPi
|
## Running on RaspberryPi
|
||||||
|
|
||||||
To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags [list in the Java version section](#running-minecraft-server-on-different-java-version) that specify `armv7` for the architecture, which includes `itzg/minecraft-server:latest`.
|
To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags [list in the Java version section](#running-minecraft-server-on-different-java-version) that specify `armv7` for the architecture, such as
|
||||||
|
|
||||||
|
itzg/minecraft-server:multiarch
|
||||||
|
|
||||||
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
branches_list=(
|
branches_list=(
|
||||||
'java8'
|
'java8'
|
||||||
'java8-multiarch'
|
'java8-multiarch'
|
||||||
'java8-openj9'
|
'openj9'
|
||||||
'java11'
|
'openj9-11'
|
||||||
'java11-openj9'
|
'adopt11'
|
||||||
'java16'
|
'java15'
|
||||||
'java16-openj9'
|
'java15-openj9'
|
||||||
|
'multiarch'
|
||||||
'multiarch-latest'
|
'multiarch-latest'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 65 KiB |
@@ -1,4 +1,4 @@
|
|||||||
version: '3.8'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
minecraft:
|
minecraft:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3.8'
|
version: '3.2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
image: ${IMAGE:-itzg/minecraft-server}
|
|
||||||
environment:
|
|
||||||
EULA: "true"
|
|
||||||
TYPE: FABRIC
|
|
||||||
ports:
|
|
||||||
- 25565:25565
|
|
||||||
volumes:
|
|
||||||
- fabric:/data
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
fabric: {}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.8"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.8"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3.8'
|
version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3.8'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.8"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
mc:
|
|
||||||
# Only using IMAGE variable to allow for local testing
|
|
||||||
image: ${IMAGE:-itzg/minecraft-server}
|
|
||||||
ports:
|
|
||||||
- 25565:25565
|
|
||||||
environment:
|
|
||||||
EULA: "TRUE"
|
|
||||||
TYPE: SPIGOT
|
|
||||||
SPIGET_RESOURCES: 9089,34315,3836
|
|
||||||
volumes:
|
|
||||||
- data:/data
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
data: {}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
version: '3.8'
|
version: '3'
|
||||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
# 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 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.
|
# 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.8"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
||||||
|
|
||||||
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/3012800>.
|
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/2787018>.
|
||||||
|
|||||||
@@ -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,10 +3,10 @@
|
|||||||
[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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||||
echo "Healthcheck disabled"
|
echo "Healthcheck disabled"
|
||||||
exit 0
|
exit 0
|
||||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||||
echo "Java process suspended by Autopause function"
|
echo "Java process suspended by Autopause function"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
|||||||
4
start
4
start
@@ -5,7 +5,7 @@
|
|||||||
umask 0002
|
umask 0002
|
||||||
chmod g+w /data
|
chmod g+w /data
|
||||||
|
|
||||||
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
if [ $(id -u) = 0 ]; then
|
||||||
runAsUser=minecraft
|
runAsUser=minecraft
|
||||||
runAsGroup=minecraft
|
runAsGroup=minecraft
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ shopt -s nullglob
|
|||||||
#umask 002
|
#umask 002
|
||||||
export HOME=/data
|
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 [ ! -e /data/eula.txt ]; then
|
||||||
if ! isTrue "$EULA"; then
|
if ! isTrue "$EULA"; then
|
||||||
log ""
|
log ""
|
||||||
@@ -30,6 +28,15 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
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
|
if [[ $PROXY ]]; then
|
||||||
export http_proxy="$PROXY"
|
export http_proxy="$PROXY"
|
||||||
export https_proxy="$PROXY"
|
export https_proxy="$PROXY"
|
||||||
@@ -56,7 +63,7 @@ fi
|
|||||||
|
|
||||||
if ! which java > /dev/null; then
|
if ! which java > /dev/null; then
|
||||||
log "Fixing PATH to include java"
|
log "Fixing PATH to include java"
|
||||||
PATH="${PATH}:/opt/java/openjdk/bin"
|
PATH="${PATH}:/usr/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
@@ -98,12 +105,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
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 "$@"
|
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -111,17 +112,7 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FTBA)
|
|
||||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
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 "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -161,19 +152,11 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployYatopia "$@"
|
exec ${SCRIPTS:-/}start-deployYatopia "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
AIRPLANE)
|
|
||||||
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
CANYON)
|
|
||||||
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
log "Invalid type: '$TYPE'"
|
log "Invalid type: '$TYPE'"
|
||||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
||||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON"
|
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
|
||||||
isDebugging && set -x
|
|
||||||
|
|
||||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
|
|
||||||
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
|
||||||
AIRPLANE_BRANCH="1.17"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "1.16" ]; then
|
|
||||||
AIRPLANE_BRANCH="1.16"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "PURPUR" ]; then
|
|
||||||
AIRPLANE_BRANCH="Purpur-1.17"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${VERSION}" = "PURPUR-1.16" ]; then
|
|
||||||
AIRPLANE_BRANCH="Purpur-1.16"
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
|
||||||
|
|
||||||
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
|
||||||
|
|
||||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
|
||||||
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-airplane.jar"
|
|
||||||
log "Downloading Airplane 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 "$@"
|
|
||||||
@@ -64,11 +64,7 @@ function downloadSpigot {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $downloadUrl ]]; then
|
if [[ -z $downloadUrl ]]; then
|
||||||
if versionLessThan 1.16.5; then
|
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
|
||||||
else
|
|
||||||
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setServerVar
|
setServerVar
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ isDebugging && set -x
|
|||||||
export FTB_BASE_DIR
|
export FTB_BASE_DIR
|
||||||
|
|
||||||
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||||
export TYPE=CURSEFORGE
|
export TYPE=FEED-THE-BEAST
|
||||||
|
|
||||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
|||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
|
|
||||||
serverJar=$(find ${FTB_BASE_DIR} -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
||||||
if [[ -z "$serverJar" ]]; then
|
if [[ -z "$serverJar" ]]; then
|
||||||
|
|
||||||
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||||
@@ -85,14 +85,13 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Installing forge server"
|
log "Installing forge server"
|
||||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer)
|
||||||
(cd "${dirOfInstaller}"; java -jar $(basename "${forgeInstallerJar}") --installServer)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
|
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
||||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||||
log "ERROR unable to locate installed forge server jar"
|
log "ERROR unable to locate installed forge server jar"
|
||||||
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
||||||
@@ -110,7 +109,6 @@ entryScriptExpr="
|
|||||||
-o -name ServerStartLinux.sh
|
-o -name ServerStartLinux.sh
|
||||||
-o -name LaunchServer.sh
|
-o -name LaunchServer.sh
|
||||||
-o -name server-start.sh
|
-o -name server-start.sh
|
||||||
-o -name start-server.sh
|
|
||||||
-o -name startserver.sh
|
-o -name startserver.sh
|
||||||
-o -name StartServer.sh
|
-o -name StartServer.sh
|
||||||
"
|
"
|
||||||
@@ -169,23 +167,13 @@ if [[ $startScriptCount = 0 ]]; then
|
|||||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
|
|
||||||
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
|
||||||
if [[ "$installScript" ]]; then
|
|
||||||
(
|
|
||||||
cd "$(dirname "${installScript}")"
|
|
||||||
chmod +x ./install.sh
|
|
||||||
log "Running included install.sh"
|
|
||||||
./install.sh
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||||
|
|
||||||
# Allow up to 2 levels since some modpacks have a top-level directory named
|
# Allow up to 2 levels since some modpacks have a top-level directory named
|
||||||
# for the modpack
|
# for the modpack
|
||||||
forgeJar=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
|
forgeJar=$(find ${FTB_BASE_DIR} -maxdepth 2 -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||||
if [[ "$forgeJar" ]]; then
|
if [[ "$forgeJar" ]]; then
|
||||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||||
log "No entry script found, so building one for ${forgeJar}"
|
log "No entry script found, so building one for ${forgeJar}"
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/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 "$@"
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
#!/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)
|
|
||||||
fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .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
|
|
||||||
fabric-${mcVersion}-${fabricVersion}-server-launch.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 FTB server jar"
|
|
||||||
ls *.jar
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Continue to Final Setup
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
@@ -3,43 +3,54 @@ set -eu
|
|||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
requireVar VANILLA_VERSION
|
|
||||||
export TYPE=FABRIC
|
export TYPE=FABRIC
|
||||||
export SERVER=fabric-server-${VANILLA_VERSION}.jar
|
|
||||||
|
|
||||||
isDebugging && set -x
|
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||||
|
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||||
if [[ ! -e ${SERVER} ]]; then
|
FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}}
|
||||||
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
: ${FABRIC_INSTALLER:=}
|
log "Checking Fabric version information."
|
||||||
: ${FABRIC_INSTALLER_URL:=}
|
case $FABRIC_INSTALLER_VERSION in
|
||||||
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
LATEST)
|
||||||
|
|
||||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
|
||||||
log "Checking Fabric version information."
|
|
||||||
if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
|
||||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
markerVersion=$FABRIC_INSTALLER_VERSION
|
||||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
|
||||||
FABRIC_INSTALLER="fabric-installer.jar"
|
|
||||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
|
||||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||||
|
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||||
|
markerVersion=custom
|
||||||
|
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
|
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}"
|
||||||
|
|
||||||
|
debug Checking for installMarker ${installMarker}
|
||||||
|
if [[ ! -e $installMarker ]]; then
|
||||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
|
||||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
exit 2
|
log "...trying $downloadUrl"
|
||||||
|
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||||
|
else
|
||||||
|
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||||
|
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||||
|
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
if isDebugging; then
|
||||||
|
debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||||
|
else
|
||||||
|
log "Installing Fabric using $FABRIC_INSTALLER"
|
||||||
|
fi
|
||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
@@ -56,9 +67,13 @@ if [[ ! -e ${SERVER} ]]; then
|
|||||||
log "Fabric failed to install after several tries." >&2
|
log "Fabric failed to install after several tries." >&2
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
export SERVER=fabric-server-launch.jar
|
||||||
|
log "Using server $SERVER"
|
||||||
|
echo $SERVER > $installMarker
|
||||||
|
|
||||||
mv fabric-server-launch.jar ${SERVER}
|
else
|
||||||
|
export SERVER=$(< $installMarker)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Contineut to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ if [ ! -e $installMarker ]; then
|
|||||||
log "Unable to compute URL for $normForgeVersion"
|
log "Unable to compute URL for $normForgeVersion"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
|
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||||
log "...trying $downloadUrl"
|
log "...trying $downloadUrl"
|
||||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ isDebugging && set -x
|
|||||||
requireVar VANILLA_VERSION
|
requireVar VANILLA_VERSION
|
||||||
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
||||||
|
|
||||||
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
||||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||||
|
|
||||||
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
||||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -26,7 +26,7 @@ buildRelPath=$(
|
|||||||
baseName=$(basename "${buildRelPath}")
|
baseName=$(basename "${buildRelPath}")
|
||||||
if [[ ${baseName} != *-server.jar* ]]; then
|
if [[ ${baseName} != *-server.jar* ]]; then
|
||||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ isDebugging && set -x
|
|||||||
: ${FORCE_REDOWNLOAD:=false}
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
|
|
||||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||||
PURPUR_BUILD=$(curl -fsSL "https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}" |
|
PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" |
|
||||||
jq -r '.builds.latest' || echo "")
|
jq -r '.builds.latest' || echo "")
|
||||||
if [[ -z ${PURPUR_BUILD} ]]; then
|
if [[ -z ${PURPUR_BUILD} ]]; then
|
||||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||||
@@ -22,7 +22,7 @@ fi
|
|||||||
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
||||||
|
|
||||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
downloadUrl="https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
downloadUrl="https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||||
log "Downloading Purpur from $downloadUrl ..."
|
log "Downloading Purpur from $downloadUrl ..."
|
||||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
@@ -34,4 +34,5 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
# Continue to Final Setup
|
||||||
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
if [ "${VERSION}" != "LATEST" ]; then
|
if [ "${VERSION}" != "LATEST" ]; then
|
||||||
log "ERROR: Tuinity server type only supports VERSION=LATEST"
|
log "ERROR: Tunity server type only supports VERSION=LATEST"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${TUINITY_BUILD:=lastSuccessfulBuild}
|
: ${TUNITY_BUILD:=lastSuccessfulBuild}
|
||||||
export SERVER=tuinity-${VANILLA_VERSION}-${TUINITY_BUILD}.jar
|
export SERVER=tunity-${VANILLA_VERSION}-${TUNITY_BUILD}.jar
|
||||||
|
|
||||||
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUINITY_BUILD}/artifact/tuinity-paperclip.jar"
|
downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUNITY_BUILD}/artifact/tuinity-paperclip.jar"
|
||||||
log "Downloading Tuinity (build $TUINITY_BUILD) from $downloadUrl ..."
|
log "Downloading Tunity (build $TUNITY_BUILD) from $downloadUrl ..."
|
||||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||||
if [ ! -f "$SERVER" ]; then
|
if [ ! -f "$SERVER" ]; then
|
||||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
@@ -23,4 +23,5 @@ fi
|
|||||||
# Normalize on Spigot for later operations
|
# Normalize on Spigot for later operations
|
||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
# Continue to Final Setup
|
||||||
|
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ IFS=$'\n\t'
|
|||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
: ${VANILLA_VERSION:?}
|
: ${VANILLA_VERSION:?}
|
||||||
: ${RELEASE:=latest}
|
: ${RELEASE:=stable}
|
||||||
: ${FORCE_REDOWNLOAD:=false}
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
|
|
||||||
requireEnum RELEASE stable latest
|
requireEnum RELEASE stable latest
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
|||||||
$dirExcludes \
|
$dirExcludes \
|
||||||
-type f \
|
-type f \
|
||||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||||
-or -name "*.conf" -or -name "*.properties" -or -name "*.hjson" -or -name "*.json" \) \
|
-or -name "*.conf" -or -name "*.properties" \) \
|
||||||
$fileExcludes \
|
$fileExcludes \
|
||||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -11,9 +11,21 @@ fi
|
|||||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||||
|
|
||||||
# Remove old mods/plugins
|
# Remove old mods/plugins
|
||||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
if isTrue ${REMOVE_OLD_MODS}; then
|
||||||
removeOldMods /data/mods
|
remove_mods_dest="/data/mods"
|
||||||
removeOldMods /data/plugins
|
case ${TYPE} in
|
||||||
|
SPIGOT|BUKKIT|PAPER)
|
||||||
|
remove_mods_dest="/data/plugins"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# only try to remove existing mods dir
|
||||||
|
if [ -d "$remove_mods_dest" ]; then
|
||||||
|
log "Removing old mods in $remove_mods_dest..."
|
||||||
|
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||||
|
else
|
||||||
|
log "Directory $remove_mods_dest does not exist; removing nothing."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||||
@@ -25,39 +37,35 @@ if [[ "$MODPACK" ]]; then
|
|||||||
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
||||||
if ! [[ $downloadUrl == *.zip ]]; then
|
if ! [[ $downloadUrl == *.zip ]]; then
|
||||||
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
||||||
log " Must be HTTP, HTTPS or FTP and a ZIP file"
|
log " Must be HTTP or HTTPS and a ZIP file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Downloading mod/plugin pack"
|
log "Downloading mod/plugin pack via HTTP"
|
||||||
log " from $downloadUrl ..."
|
log " from $downloadUrl ..."
|
||||||
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
||||||
log "ERROR: failed to download from $downloadUrl"
|
log "ERROR: failed to download from $downloadUrl"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
elif [[ "$MODPACK" =~ .*\.zip ]]; then
|
|
||||||
if ! cp $MODPACK /tmp/modpack.zip; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
log "ERROR: failed to copy from $MODPACK"
|
mkdir -p /data/plugins
|
||||||
exit 2
|
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
|
fi
|
||||||
|
rm -f /tmp/modpack.zip
|
||||||
|
|
||||||
else
|
else
|
||||||
log "ERROR Invalid URL or Path given for MODPACK: $MODPACK"
|
log "ERROR Invalid URL given for MODPACK: $MODPACK"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# If supplied with a URL for a plugin download it.
|
# If supplied with a URL for a plugin download it.
|
||||||
@@ -91,18 +99,8 @@ if [[ "$MODS" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
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
|
else
|
||||||
log "ERROR Invalid URL or path given in MODS: $i"
|
log "ERROR Invalid URL given in MODS: $i"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,20 +21,18 @@ if [ -d /plugins ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
: ${COPY_MODS_DEST:="/data/mods"}
|
|
||||||
|
|
||||||
if [ -d /mods ]; then
|
if [ -d /mods ]; then
|
||||||
log "Copying any mods over..."
|
log "Copying any mods over..."
|
||||||
mkdir -p "${COPY_MODS_DEST}"
|
mkdir -p /data/mods
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ "${COPY_MODS_DEST}"
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||||
|
|
||||||
if [ -d /config ]; then
|
if [ -d /config ]; then
|
||||||
log "Copying any configs from /config to ${COPY_CONFIG_DEST}"
|
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
||||||
mkdir -p "${COPY_CONFIG_DEST}"
|
mkdir -p $COPY_CONFIG_DEST
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ "${COPY_CONFIG_DEST}"
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function setServerProp {
|
|||||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||||
else
|
else
|
||||||
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
||||||
echo "${prop}=${var}" >> "$SERVER_PROPERTIES"
|
echo "${prop}=${var//\\/\\\\}" >> "$SERVER_PROPERTIES"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
isDebugging && log "Skip setting ${prop}"
|
isDebugging && log "Skip setting ${prop}"
|
||||||
@@ -27,7 +27,7 @@ function setServerProp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function customizeServerProps {
|
function customizeServerProps {
|
||||||
if [ -n "$WHITELIST" ] || isTrue ${ENABLE_WHITELIST:-false}; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
log "Creating whitelist"
|
log "Creating whitelist"
|
||||||
setServerProp "whitelist" "true"
|
setServerProp "whitelist" "true"
|
||||||
setServerProp "white-list" "true"
|
setServerProp "white-list" "true"
|
||||||
@@ -181,8 +181,8 @@ function customizeServerProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Deploy server.properties file
|
# Deploy server.properties file
|
||||||
if [[ ${TYPE} == "CURSEFORGE" ]]; then
|
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||||
export SERVER_PROPERTIES="${FTB_DIR}/server.properties"
|
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||||
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ fi
|
|||||||
|
|
||||||
if isDebugging; then
|
if isDebugging; then
|
||||||
log "DEBUG Dumping server.properties"
|
log "DEBUG Dumping server.properties"
|
||||||
cat "${SERVER_PROPERTIES}"
|
cat /data/server.properties
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ isDebugging && set -x
|
|||||||
: ${LEVEL:=world}
|
: ${LEVEL:=world}
|
||||||
export LEVEL
|
export LEVEL
|
||||||
|
|
||||||
if [ $TYPE = "CURSEFORGE" ]; then
|
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||||
worldDest=$FTB_DIR/$LEVEL
|
worldDest=$FTB_DIR/$LEVEL
|
||||||
else
|
else
|
||||||
worldDest=/data/$LEVEL
|
worldDest=/data/$LEVEL
|
||||||
|
|||||||
@@ -38,16 +38,16 @@ if [ -n "$ICON" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
||||||
# Set up log configuration
|
# Set up log configuration
|
||||||
LOGFILE="/data/log4j2.xml"
|
LOGFILE="/data/log4j2.xml"
|
||||||
if [ ! -e "$LOGFILE" ]; then
|
if [ ! -e "$LOGFILE" ]; then
|
||||||
log "Creating log4j2.xml in ${LOGFILE}"
|
log "Creating log4j2.xml in ${LOGFILE}"
|
||||||
cp /tmp/log4j2.xml "$LOGFILE"
|
cp /tmp/log4j2.xml "$LOGFILE"
|
||||||
else
|
else
|
||||||
log "log4j2.xml already created, skipping"
|
log "log4j2.xml already created, skipping"
|
||||||
fi
|
fi
|
||||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||||
@@ -144,13 +144,6 @@ if isTrue "${USE_LARGE_PAGES}"; then
|
|||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue "${USE_FLARE_FLAGS}"; then
|
|
||||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
|
||||||
-XX:+UnlockDiagnosticVMOptions
|
|
||||||
-XX:+DebugNonSafepoints
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if isTrue "${DEBUG_MEMORY}"; then
|
if isTrue "${DEBUG_MEMORY}"; then
|
||||||
log "Memory usage and availability (in MB)"
|
log "Memory usage and availability (in MB)"
|
||||||
uname -a
|
uname -a
|
||||||
@@ -180,7 +173,7 @@ if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
|||||||
exec mc-server-runner ${mcServerRunnerArgs} \
|
exec mc-server-runner ${mcServerRunnerArgs} \
|
||||||
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
|
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
|
||||||
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
|
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
|
||||||
elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
elif [[ ${TYPE} == "FEED-THE-BEAST" && "${SERVER}" ]]; then
|
||||||
copyFilesForCurseForge
|
copyFilesForCurseForge
|
||||||
|
|
||||||
cd "${FTB_DIR}"
|
cd "${FTB_DIR}"
|
||||||
@@ -189,7 +182,7 @@ elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
|
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
|
||||||
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
elif [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||||
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
||||||
|
|
||||||
copyFilesForCurseForge
|
copyFilesForCurseForge
|
||||||
@@ -207,24 +200,10 @@ EOF
|
|||||||
|
|
||||||
cd "${FTB_DIR}"
|
cd "${FTB_DIR}"
|
||||||
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||||
|
|
||||||
finalArgs=(
|
|
||||||
"${FTB_SERVER_START}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if isTrue ${SETUP_ONLY:=false}; then
|
|
||||||
echo "SETUP_ONLY: ${finalArgs[@]}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
if isTrue ${EXEC_DIRECTLY:-false}; then
|
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
|
||||||
"${finalArgs[@]}"
|
|
||||||
else
|
|
||||||
exec mc-server-runner ${mcServerRunnerArgs} "${finalArgs[@]}"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||||
if [ -f /data/bootstrap.txt ]; then
|
if [ -f /data/bootstrap.txt ]; then
|
||||||
@@ -232,28 +211,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Starting the Minecraft server..."
|
log "Starting the Minecraft server..."
|
||||||
|
|
||||||
finalArgs=(
|
|
||||||
$JVM_XX_OPTS
|
|
||||||
$JVM_OPTS
|
|
||||||
$expandedDOpts
|
|
||||||
-jar $SERVER
|
|
||||||
"$@" $EXTRA_ARGS
|
|
||||||
)
|
|
||||||
|
|
||||||
if isTrue ${SETUP_ONLY:=false}; then
|
|
||||||
echo "SETUP_ONLY: java ${finalArgs[@]}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
|
||||||
if isTrue ${EXEC_DIRECTLY:-false}; then
|
|
||||||
exec java "${finalArgs[@]}"
|
|
||||||
else
|
|
||||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
45
start-spiget
45
start-spiget
@@ -16,7 +16,7 @@ containsJars() {
|
|||||||
if [[ $line =~ $pat ]]; then
|
if [[ $line =~ $pat ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done <<<$(unzip -l "$file")
|
done <<< $(unzip -l "$file")
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -26,41 +26,30 @@ getResourceFromSpiget() {
|
|||||||
|
|
||||||
log "Downloading resource ${resource} ..."
|
log "Downloading resource ${resource} ..."
|
||||||
|
|
||||||
|
tmpfile="/tmp/${resource}.zip"
|
||||||
|
url="https://api.spiget.org/v2/resources/${resource}/download"
|
||||||
|
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
||||||
|
log "ERROR failed to download resource '${resource}' from ${url}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p /data/plugins
|
mkdir -p /data/plugins
|
||||||
|
if containsJars "${tmpfile}"; then
|
||||||
if [ -f /data/plugins/.${resource} ]; then
|
log "Extracting contents of resource ${resource} into plugins"
|
||||||
log "Resource '${resource}' already downloaded"
|
unzip -o -q -d /data/plugins "${tmpfile}"
|
||||||
|
rm "${tmpfile}"
|
||||||
else
|
else
|
||||||
tmpfile="/tmp/${resource}.zip"
|
log "Moving resource ${resource} into plugins"
|
||||||
url="https://api.spiget.org/v2/resources/${resource}/download"
|
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
||||||
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
|
||||||
log "ERROR failed to download resource '${resource}' from ${url}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if containsJars "${tmpfile}"; then
|
|
||||||
log "Extracting contents of resource ${resource} into plugins"
|
|
||||||
unzip -o -q -d /data/plugins "${tmpfile}"
|
|
||||||
touch "/data/plugins/.${resource}"
|
|
||||||
rm "${tmpfile}"
|
|
||||||
else
|
|
||||||
log "Moving resource ${resource} into plugins"
|
|
||||||
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
|
||||||
touch "/data/plugins/.${resource}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ ${SPIGET_RESOURCES} ]]; then
|
if [[ ${SPIGET_RESOURCES} ]]; then
|
||||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
|
||||||
removeOldMods /data/plugins
|
|
||||||
REMOVE_OLD_MODS=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "Getting plugins via Spiget"
|
log "Getting plugins via Spiget"
|
||||||
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}"
|
IFS=',' read -r -a resources <<< "${SPIGET_RESOURCES}"
|
||||||
for resource in "${resources[@]}"; do
|
for resource in "${resources[@]}"
|
||||||
|
do
|
||||||
getResourceFromSpiget "${resource}"
|
getResourceFromSpiget "${resource}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function join_by() {
|
|||||||
function isURL() {
|
function isURL() {
|
||||||
local value=$1
|
local value=$1
|
||||||
|
|
||||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
|
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -174,9 +174,3 @@ eula=${EULA,,}
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
args:
|
|
||||||
TARGETOS: linux
|
|
||||||
TARGETARCH: amd64
|
|
||||||
cache_from:
|
cache_from:
|
||||||
- itzg/minecraft-server:latest
|
- itzg/minecraft-server:latest
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user