Compare commits

..

36 Commits

Author SHA1 Message Date
Geoff Bourne
4148325787 Auto-merging via docker-versions-create 2021-06-05 17:50:27 -05:00
Geoff Bourne
7083cd15e8 Auto-merging via docker-versions-create 2021-05-24 20:50:17 -05:00
Geoff Bourne
7418dab476 Merge branch 'master' into java8-multiarch 2021-05-23 12:26:47 -05:00
Geoff Bourne
94bbc8e649 Merge from master 2021-05-22 12:59:25 -05:00
Geoff Bourne
3e5e62229a Auto-merging via docker-versions-create 2021-05-21 23:01:34 -05:00
Geoff Bourne
fe2a9d56ed Auto-merging via docker-versions-create 2021-05-21 22:47:56 -05:00
Geoff Bourne
27571999b2 Merge branch 'master' into java8-multiarch 2021-05-21 17:28:44 -05:00
Geoff Bourne
bbd7d9e39a ci: introduced CACHE_NAME 2021-05-21 17:26:42 -05:00
Geoff Bourne
ef6f308229 Auto-merging via docker-versions-create 2021-05-19 20:27:42 -05:00
Geoff Bourne
49d89d3e73 Auto-merging via docker-versions-create 2021-05-19 20:25:00 -05:00
Geoff Bourne
74203b23f4 Auto-merging via docker-versions-create 2021-05-15 12:41:22 -05:00
Geoff Bourne
4fb791b490 Merge branch 'multiarch' into java8-multiarch
# Conflicts:
#	Dockerfile
#	start-configuration
2021-05-14 17:59:49 -05:00
Geoff Bourne
ced25ad50a Auto-merging via docker-versions-create 2021-05-06 20:12:55 -05:00
Geoff Bourne
48efc224ba Auto-merging via docker-versions-create 2021-04-30 14:28:07 -05:00
Geoff Bourne
467c1d9954 Auto-merging via docker-versions-create 2021-04-30 11:11:46 -05:00
Geoff Bourne
9ced230f55 Auto-merging via docker-versions-create 2021-04-28 16:51:29 -05:00
Geoff Bourne
f3a8276362 Auto-merging via docker-versions-create 2021-04-26 08:21:06 -05:00
Geoff Bourne
b91d63716e Auto-merging via docker-versions-create 2021-04-24 13:42:37 -05:00
Geoff Bourne
46cccfd531 Auto-merging via docker-versions-create 2021-04-23 21:03:21 -05:00
Geoff Bourne
9fe1cb4a0d ci: Switched multiarch-java8 to be based on adoptopenjdk:8-jre-hotspot 2021-04-21 20:13:22 -05:00
Geoff Bourne
076038b470 Auto-merging via docker-versions-create 2021-04-18 13:29:46 -05:00
Geoff Bourne
aa416729ea Auto-merging via docker-versions-create 2021-04-11 10:09:19 -05:00
Geoff Bourne
812c6365ec Merged latest from master 2021-04-08 19:14:45 -05:00
Geoff Bourne
42a5131b19 Merging latest from master 2021-04-01 16:32:55 -05:00
Geoff Bourne
624f6a210f Added git
#819
2021-04-01 16:28:32 -05:00
Geoff Bourne
1c63cd18b7 Merge branch 'master' into java8-multiarch
# Conflicts:
#	start-configuration
2021-03-06 16:24:55 -06:00
Geoff Bourne
6266a7e3cc Shifted PATH-fix earlier in startup 2021-03-06 16:04:31 -06:00
Geoff Bourne
871ecd4d9d Merge branch 'master' into java8-multiarch
# Conflicts:
#	start-minecraftFinalSetup
2021-02-27 20:52:36 -06:00
Geoff Bourne
c572c95161 Ensure FTBA version.json is readable
#784
2021-02-27 16:58:25 -06:00
Geoff Bourne
f7b58fbbb1 Fix PATH to include java when needed 2021-02-10 14:51:24 -06:00
Geoff Bourne
eccfa444a9 Auto-merging via docker-versions-create 2021-02-10 14:02:05 -06:00
Geoff Bourne
e831d25706 Merged latest from master 2021-02-08 21:18:28 -06:00
Geoff Bourne
12e931332b Auto-merging via docker-versions-create
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 18:06:06 -06:00
Geoff Bourne
ceee9eddc9 ci: restored base image to ubuntu and install openjdk-8 2021-02-06 15:53:59 -06:00
Geoff Bourne
60ba668743 Merge branch 'master' into java8-multiarch
# Conflicts:
#	Dockerfile
2021-02-06 15:49:16 -06:00
Geoff Bourne
fd1b15e01f ci: Added java8 variant of multiarch 2021-02-06 15:44:02 -06:00
358 changed files with 3215 additions and 12080 deletions

19
.gitattributes vendored
View File

@@ -1,2 +1,17 @@
# Auto detect text files and perform LF normalization
* text=lf
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

4
.github/FUNDING.yml vendored
View File

@@ -1,4 +0,0 @@
github: itzg
custom:
- https://www.buymeacoffee.com/itzg
- https://paypal.me/itzg

View File

@@ -1,41 +0,0 @@
name: Bug Report
description: File a bug report
labels:
- bug
- status/needs triage
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug.
Please double check some things first:
1. Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
2. Did you re-pull the newest image using `docker pull`?
3. Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
4. Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
- type: textarea
id: problem
attributes:
label: Describe the problem
validations:
required: true
- type: textarea
id: container
attributes:
label: Container definition
description: Please provide the compose file or run command used to create the container
value: |
```
Paste run command or compose file here
```
- type: textarea
id: logs
attributes:
label: Container logs
description: |
Please provide container logs from the start of the container, which will be the ones prefixed with `[init]`. It is even better if you can set the variable `DEBUG` to "true" and provide those debug container logs.
value: |
```
Paste logs here
```

View File

@@ -1,7 +0,0 @@
contact_links:
- name: Ask a question in discussions
url: https://github.com/itzg/docker-minecraft-server/discussions
about: Please ask questions here
- name: Ask a question on Discord
url: https://discord.gg/DXfKpjB
about: Please ask questions here

View File

@@ -1,29 +0,0 @@
name: Enhancement Request
description: Request an enhancement
labels:
- enhancement
- status/needs triage
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to request an enhancement.
Even if you plan on submitting a pull request with a contributed enhancement it is best to describe the enhancement here first. Somebody might already be working on a similar thing and could use your help.
- type: dropdown
id: type
attributes:
label: Enhancement Type
options:
- Improve an existing feature
- A completely new feature
- New server type
- Not sure
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the enhancement
validations:
required: true

6
.github/no-response.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
daysUntilClose: 14
responseRequiredLabel: "status/waiting on feedback"
closeComment: >
This issue has been automatically closed because there has been no response
after requesting feedback. Please feel free to re-open this issue if the
scenario still exists and provide a comment with more information.

17
.github/release.yml vendored
View File

@@ -1,17 +0,0 @@
changelog:
exclude:
authors:
- dependabot
categories:
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"

View File

@@ -1,212 +1,82 @@
name: Test and Build multi-architecture
name: Build and publish multiarch
on:
push:
branches:
- master
- test/**
- "*-multiarch"
- "multiarch*"
- java8-openj9
- java11*
- java16*
- test/multiarch/*
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]+-java8-openj9"
- "[0-9]+.[0-9]+.[0-9]+-java11*"
- "[0-9]+.[0-9]+.[0-9]+-java16*"
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
jobs:
build:
strategy:
fail-fast: false
matrix:
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
variant:
- java20
- java20-alpine
- java17
- java17-graalvm-ce
- java17-jdk
- java17-openj9
- java17-alpine
- java8
- java8-graalvm-ce
- java8-multiarch
- java8-openj9
- java8-jdk
- java11
- java11-openj9
- java11-jdk
include:
# JAVA 20:
- variant: java20
baseImage: eclipse-temurin:20-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.19.3
- variant: java20-alpine
baseImage: eclipse-temurin:20-jre-alpine
platforms: linux/amd64
mcVersion: 1.19.3
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
- variant: java17-graalvm-ce
baseImage: ghcr.io/graalvm/graalvm-ce:ol8-java17
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
- variant: java17-jdk
baseImage: eclipse-temurin:17-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.18.2
- variant: java17-openj9
baseImage: ibm-semeru-runtimes:open-17-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.18.2
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.18.2
# JAVA 11:
- variant: java11
baseImage: adoptopenjdk:11-jre-hotspot
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5
- variant: java11-jdk
baseImage: adoptopenjdk:11-jdk-hotspot
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5
- variant: java11-openj9
baseImage: ibm-semeru-runtimes:open-11-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.16.5
# JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies
- variant: java8
baseImage: openjdk:8-jre-alpine3.9
platforms: linux/amd64
mcVersion: 1.12.2
- variant: java8-graalvm-ce
baseImage: ghcr.io/graalvm/graalvm-ce:java8
platforms: linux/amd64
mcVersion: 1.12.2
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.12.2
- variant: java8-jdk
baseImage: eclipse-temurin:8u312-b07-jdk-focal
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
- variant: java8-openj9
baseImage: ibm-semeru-runtimes:open-8u312-b07-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2
env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
HAS_IMAGE_REPO_ACCESS: ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
MAIN_VARIANT: java17
docker-buildx:
runs-on: ubuntu-20.04
env:
CACHE_NAME: java8-multiarch
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# for build-files step
fetch-depth: 0
uses: actions/checkout@v2.3.4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v3
with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced.
images: |
${{ github.repository_owner }}/minecraft-server
ghcr.io/${{ github.repository_owner }}/minecraft-server
itzg/minecraft-server
tags: |
# For the "main" variant, it gets the tag as-is, without suffix
type=ref,event=tag,enable=${{ matrix.variant == env.MAIN_VARIANT }}
# and each variant (including main one) gets the tag with the variant suffix, such as 2023.1.1-java17
type=ref,event=tag,suffix=-${{ matrix.variant }}
# for building test/* branch images
type=ref,event=branch,suffix=-${{ matrix.variant }},enable=${{ github.ref_name != github.event.repository.default_branch }}
# latest repo tag gets a moving 'stable' image tag applied to the main variant
type=raw,value=stable,enable=${{ github.ref_type == 'tag' && matrix.variant == env.MAIN_VARIANT }}
# apply the variant as a moving tag for most recent commit per variant
type=raw,value=${{ matrix.variant }},enable=${{ github.ref_name == github.event.repository.default_branch }}
# NOTE this identifies which variant will be published as "latest", which isn't
# necessarily the newest version of Java
type=ref,event=branch
type=ref,event=tag
type=edge,branch=master
flavor: |
latest=${{ matrix.variant == env.MAIN_VARIANT && github.ref_name == github.event.repository.default_branch }}
labels: |
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
latest=false
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
${{ runner.os }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
- name: Build for test
uses: docker/build-push-action@v4.1.1
with:
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used
pull: true
# load into daemon for test usage in next step
load: true
push: false
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
# no cache-to to avoid cross-cache update from next build step
- name: Run tests
env:
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
VARIANT: ${{ matrix.variant }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
CF_API_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
run: |
tests/test.sh
uses: docker/setup-qemu-action@v1.2.0
- name: Login to DockerHub
uses: docker/login-action@v2
if: env.HAS_IMAGE_REPO_ACCESS
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v2
if: env.HAS_IMAGE_REPO_ACCESS
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v4.1.1
if: github.actor == github.repository_owner
id: docker_build
uses: docker/build-push-action@v2.5.0
with:
platforms: ${{ matrix.platforms }}
push: >
${{
github.ref_type == 'tag'
|| github.ref_name == github.event.repository.default_branch
|| startsWith(github.ref_name, 'test/')
|| ( github.event_name == 'pull_request'
&& env.HAS_IMAGE_REPO_ACCESS
&& contains(github.event.pull_request.labels.*.name, 'ci/push-image')
)
}}
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
pull: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
labels: ${{ steps.meta.outputs.labels }}
# Since some consumers, like Watchtower are broken https://github.com/containrrr/watchtower/discussions/1529
# Also refer to https://github.com/docker/build-push-action/releases/tag/v3.3.0
provenance: false
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
BUILD_FILES_REV=${{ steps.build-files-rev.outputs.REV }}
cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -1,26 +0,0 @@
name: Discord notifications
on:
workflow_run:
workflows: ["ContinuousIntegration", "Build and Publish", "Build and publish multiarch" ]
types:
- completed
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
discord:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: on-success
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: Ilshidur/action-discord@master
with:
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🎉 ${{ github.event.workflow_run.conclusion }} 🍏"
- name: on-failure
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
uses: Ilshidur/action-discord@master
with:
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🤔 ${{ github.event.workflow_run.conclusion }} 💣💥"

20
.github/workflows/generate-toc.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Generate README table of contents
on:
push:
branches:
- master
paths:
- README.md
jobs:
generate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2.3.4
- run: |
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
chmod a+x gh-md-toc
./gh-md-toc --insert --no-backup README.md
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
with:
commit_message: "docs: Auto update markdown TOC"

View File

@@ -1,33 +0,0 @@
name: Issue labels
on:
issues:
types: [labeled, reopened, closed, deleted]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_ISSUES_WEBHOOK }}
jobs:
labelNotify:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: notify on label
if: >
github.event.label.name == 'enhancement'
|| github.event.label.name == 'bug'
|| github.event.label.name == 'help wanted'
|| github.event.label.name == 'priority/high'
|| github.event.label.name == 'question'
|| github.event.label.name == 'status/waiting on upstream'
uses: Ilshidur/action-discord@master
with:
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"
- name: notify on action change
if: >
github.event.action == 'closed'
|| github.event.action == 'reopened'
|| github.event.action == 'deleted'
uses: Ilshidur/action-discord@master
with:
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) has been `${{ github.event.action }}` by `${{ github.event.sender.login }}`"

97
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,97 @@
name: Build and Publish
on:
push:
branches:
- java8
- openj9
- openj9-11
- adopt11
- test/*
tags:
- "[0-9]+.[0-9]+.[0-9]+-java8"
- "[0-9]+.[0-9]+.[0-9]+-openj9"
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Run tests
run: |
tests/test.sh
build:
needs:
- test
runs-on: ubuntu-20.04
env:
CACHE_NAME: java8-multiarch
steps:
- uses: actions/checkout@v2.3.4
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=itzg/minecraft-server
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
if [[ $VERSION == master ]]; then
VERSION=latest
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=cache_from::${TAGS}
echo ::set-output name=version::${VERSION//\//-}
echo ::set-output name=cache_version::${VERSION//\//-}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2.1.6
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2.5.0
with:
context: .
file: ./Dockerfile
# ensure latest base image is used
pull: true
# publish
push: true
# tags determined by prep step
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
labels: |
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
org.opencontainers.image.revision=${{ github.sha }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

16
.github/workflows/pr.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Validate PR
on:
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Run tests
run: |
tests/test.sh

View File

@@ -1,25 +0,0 @@
name: Stale Check
on:
schedule:
- cron: 0 2 * * *
jobs:
check:
runs-on: ubuntu-20.04
permissions:
issues: write
pull-requests: write
steps:
- name: Process Stale Issues
uses: actions/stale@v8
with:
stale-issue-label: status/stale
stale-pr-label: status/stale
stale-issue-message: >
This issue is stale because it has been open 30 days with no activity.
Please add a comment describing the reason to keep this issue open.
days-before-stale: 30
days-before-close: 5
exempt-issue-labels: 'enhancement,keep,status/needs triage,priority/high'

View File

@@ -1,90 +0,0 @@
name: Verify PR
on:
pull_request:
branches: [ master ]
types: [assigned, opened, synchronize, labeled]
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"
- "docker-compose*.yml"
- "mkdocs.yml"
jobs:
build:
strategy:
fail-fast: false
matrix:
variant:
- java20
- java17
- java17-alpine
- java8-multiarch
include:
# JAVA 20:
- variant: java20
baseImage: eclipse-temurin:20-jre
platforms: linux/amd64,linux/arm64
mcVersion: 1.19.4
# JAVA 17:
- variant: java17
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
baseImage: eclipse-temurin:17-jre-focal
platforms: linux/amd64
mcVersion: 1.19.4
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
mcVersion: 1.19.4
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64
mcVersion: 1.12.2
env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# for build-files step
fetch-depth: 0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Confirm multi-arch build
uses: docker/build-push-action@v4.1.1
with:
platforms: ${{ matrix.platforms }}
# ensure latest base image is used
pull: true
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
- name: Build for test
uses: docker/build-push-action@v4.1.1
with:
# Only build single platform since loading multi-arch image into daemon fails with
# "docker exporter does not currently support exporting manifest lists"
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
# ensure latest base image is used
pull: true
# load into daemon for test usage in next step
load: true
push: false
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
cache-from: type=gha,scope=${{ matrix.variant }}
- name: Run tests
env:
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
VARIANT: ${{ matrix.variant }}
MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
CF_API_KEY: ${{ secrets.MODS_FORGEAPI_KEY }}
DEBUG: ${{ runner.debug }}
run: |
tests/test.sh

4
.gitignore vendored
View File

@@ -1,6 +1,4 @@
.vscode
/data/
/.idea/
*.iml
/gh-md-toc
personal-build-and-develop.*
/gh-md-toc

View File

@@ -1,15 +0,0 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
mkdocs:
configuration: mkdocs.yml
python:
install:
- requirements: docs/requirements.txt

11
BUILDING.md Normal file
View File

@@ -0,0 +1,11 @@
Ensure buildx/BuildKit support is enabled and run:
```shell script
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
```
To build for local testing, use:
```shell script
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
```

74
DEVELOPMENT.md Normal file
View File

@@ -0,0 +1,74 @@
## Adding a server type
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetupWorld` at the end of the script
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration)
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls)
## Iterative script development
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
First, build a baseline of the image to include the packages needed by existing or new scripts:
```shell script
docker build -t mc-dev .
```
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
```shell script
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
```
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
```shell script
export VANILLA_VERSION=1.12.2
/scripts/start-magma
```
...or pre-pending script execution:
```shell script
VANILLA_VERSION=1.12.2 /scripts/start-magma
```
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
## Multi-base-image variants
Several base-image variants are maintained in order to offer choices in JDK provider and version. The variants are maintained in their respective branches:
- openj9
- openj9-nightly
- adopt11
- adopt13
- multiarch
The [docker-versions-create.sh](docker-versions-create.sh) script is configured with the branches to maintain and is used to merge changes from the master branch into the mulit-base variant branches. The script also manages git tagging the master branch along with the merged branches. So a typical use of the script would be like:
```shell script
./docker-versions-create.sh -s -t 1.2.0
```
> Most often the major version will be bumped unless a bug or hotfix needs to be published in which case the patch version should be incremented.
> The build and publishing of those branches and their tags is currently performed within Docker Hub.
## multiarch support
The [multiarch branch](https://github.com/itzg/docker-minecraft-server/tree/multiarch) supports running the image on amd64, arm64, and armv7 (aka RaspberryPi). Unlike the mainline branches, it is based on Ubuntu 18.04 since the openjdk package provided by Ubuntu includes full JIT support on all of the processor types.
The multiarch images are built and published by [a Github action](https://github.com/itzg/docker-minecraft-server/actions?query=workflow%3A%22Build+and+publish+multiarch%22), which [is configured in that branch](https://github.com/itzg/docker-minecraft-server/blob/multiarch/.github/workflows/build-multiarch.yml).
## Generating release notes
The following git command can be used to provide the bulk of release notes content:
```shell script
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="- %s" 1.1.0..1.2.0
```

View File

@@ -1,74 +1,89 @@
# syntax = docker/dockerfile:1.3
ARG BASE_IMAGE=eclipse-temurin:17-jre-focal
FROM ${BASE_IMAGE}
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# CI system should set this to a hash or git revision of the build directory and it's contents to
# ensure consistent cache updates.
ARG BUILD_FILES_REV=1
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh setup-user
COPY --chmod=644 files/sudoers* /etc/sudoers.d
EXPOSE 25565
ARG EASY_ADD_VER=0.8.0
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.7.0 --var app=restify --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.6.2 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.12.1 --var app=mc-monitor --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.32.9
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
VOLUME ["/data"]
WORKDIR /data
STOPSIGNAL SIGTERM
# End user MUST set EULA and change RCON_PASSWORD
ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000
COPY --chmod=755 scripts/start* /
COPY --chmod=755 bin/ /usr/local/bin/
COPY --chmod=755 bin/mc-health /health.sh
COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
# By default this file gets retrieved from repo, but bundle in image as potential fallback
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
COPY --chmod=755 files/auto /auto
RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar
RUN dos2unix /start* /auto/*
ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m --interval=5s --retries=24 CMD mc-health
FROM adoptopenjdk:8-jre-hotspot
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
gosu \
sudo \
net-tools \
curl wget \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
unzip \
knockd \
ttf-dejavu \
&& apt-get clean
RUN addgroup --gid 1000 minecraft \
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
COPY files/sudoers* /etc/sudoers.d
EXPOSE 25565 25575
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.2.0 --var app=restify --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.4.7 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.7.1 --var app=mc-monitor --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.5.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
COPY mcstatus /usr/local/bin
VOLUME ["/data"]
COPY server.properties /tmp/server.properties
COPY log4j2.xml /tmp/log4j2.xml
WORKDIR /data
STOPSIGNAL SIGTERM
ENV UID=1000 GID=1000 \
MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST \
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
COPY start* /
COPY health.sh /
ADD files/autopause /autopause
RUN dos2unix /start* && chmod +x /start*
RUN dos2unix /health.sh && chmod +x /health.sh
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m CMD /health.sh

1385
README.md

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +0,0 @@
#!/bin/bash
. "/start-utils"
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if [ $# = 0 ]; then
echo "ERROR: pass console commands as arguments"
exit 1
fi
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
exit 1
fi
if [ "$(id -u)" = 0 ]; then
if [[ $(getDistro) == alpine ]]; then
exec su-exec minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
else
exec gosu minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
fi
else
echo "$@" >"${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
fi

View File

@@ -1,101 +0,0 @@
#!/bin/bash
: "${RCON_CMDS_STARTUP:=}"
: "${RCON_CMDS_ON_CONNECT:=}"
: "${RCON_CMDS_ON_DISCONNECT:=}"
: "${RCON_CMDS_FIRST_CONNECT:=}"
: "${RCON_CMDS_LAST_DISCONNECT:=}"
: "${RCON_CMDS_PERIOD:=10}"
# needed for the clients connected function residing in autopause
# shellcheck source=../auto/autopause-fcns.sh
. /auto/autopause-fcns.sh
# shellcheck source=start-utils
. ${SCRIPTS:-/}start-utils
run_command(){
rcon_cmd="$1"
logRcon "running - $rcon_cmd"
output=$(rcon-cli "$rcon_cmd")
logRcon "$output"
}
# wait for java process to be started
while :
do
if java_process_exists ; then
break
fi
sleep 0.1
done
CLIENTCONNECTIONS=0
STATE=INIT
while :
do
case X$STATE in
XINIT)
# Server startup
if mc_server_listening ; then
logRcon "MCServer is listening, running startup"
if [[ "$RCON_CMDS_STARTUP" ]]; then
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_STARTUP"
fi
if
[[ -z "$RCON_CMDS_ON_CONNECT" ]] &&
[[ -z "$RCON_CMDS_ON_DISCONNECT" ]] &&
[[ -z "$RCON_CMDS_FIRST_CONNECT" ]] &&
[[ -z "$RCON_CMDS_LAST_DISCONNECT" ]]
then
logRcon "No addition rcon commands are given, stopping rcon cmd service"
exit 0
fi
STATE=II
fi
;;
XII)
CURR_CLIENTCONNECTIONS=$(java_clients_connections)
# First client connection
# Setting priority run order: on first client connection is usually to STOP maintence, aka DO THIS FIRST
if (( CURR_CLIENTCONNECTIONS > 0 )) && (( CLIENTCONNECTIONS == 0 )) && [[ "$RCON_CMDS_FIRST_CONNECT" ]]; then
logRcon "First Clients has Connected, running first connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_FIRST_CONNECT"
fi
# When a client joins
if (( CURR_CLIENTCONNECTIONS > CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_CONNECT" ]]; then
logRcon "Clients have Connected, running connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_CONNECT"
# When a client leaves
elif (( CURR_CLIENTCONNECTIONS < CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_DISCONNECT" ]]; then
logRcon "Clients have Disconnected, running disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_DISCONNECT"
fi
# Last client connection
# Setting priority run order: on last client connection is usually to START maintence, aka DO THIS LAST
if (( CURR_CLIENTCONNECTIONS == 0 )) && (( CLIENTCONNECTIONS > 0 )) && [[ "$RCON_CMDS_LAST_DISCONNECT" ]]; then
logRcon "ALL Clients have Disconnected, running last disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_LAST_DISCONNECT"
fi
CLIENTCONNECTIONS=$CURR_CLIENTCONNECTIONS
;;
*)
logRcon "Error: invalid state: $STATE"
;;
esac
sleep "$RCON_CMDS_PERIOD"
done

View File

@@ -1,34 +0,0 @@
#!/bin/sh
set -e
set -o pipefail
apk add --no-cache -U \
openssl \
imagemagick \
file \
lsof \
su-exec \
coreutils \
findutils \
procps \
shadow \
bash \
curl iputils \
git \
jq \
mysql-client \
tzdata \
rsync \
nano \
sudo \
tar \
zstd \
nfs-utils \
libpcap \
libwebp
# Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd

View File

@@ -1,6 +0,0 @@
#!/bin/sh
set -e
addgroup -g 1000 minecraft
adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft

View File

@@ -1,12 +0,0 @@
#!/bin/bash
if [[ $(uname -m) == "aarch64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-arm64
chmod +x /bin/gosu
elif [[ $(uname -m) == "x86_64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.14/gosu-amd64
chmod +x /bin/gosu
else
echo "Not supported!"
exit 1
fi

View File

@@ -1,46 +0,0 @@
#!/bin/bash
export TARGET
set -euo pipefail
microdnf install dnf -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled ol8_codeready_builder
tee /etc/yum.repos.d/ol8-epel.repo<<EOF
[ol8_developer_EPEL]
name= Oracle Linux \$releasever EPEL (\$basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
dnf update -y
dnf install -y ImageMagick \
file \
sudo \
net-tools \
iputils \
curl \
git \
jq \
dos2unix \
mysql \
procps-ng \
tzdata \
rsync \
nano \
unzip \
zstd \
lbzip2 \
libpcap \
libwebp
bash /build/ol/install-gosu.sh
# Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd

View File

@@ -1,2 +0,0 @@
groupadd --gid 1000 minecraft
useradd --system --shell /bin/false --uid 1000 -g minecraft --home /data minecraft

View File

@@ -1,7 +0,0 @@
#!/bin/sh
set -e
distro=$(cat /etc/os-release | grep -E "^ID=" | cut -d= -f2 | sed -e 's/"//g')
"$(dirname "$0")/${distro}/$1".sh

View File

@@ -1,38 +0,0 @@
#!/bin/bash
export TARGET
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
file \
gosu \
sudo \
net-tools \
iputils-ping \
curl \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
unzip \
zstd \
lbzip2 \
nfs-common \
libpcap0.8 \
webp
apt-get clean
# Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;

View File

@@ -1,6 +0,0 @@
#!/bin/sh
set -e
addgroup --gid 1000 minecraft
adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft

View File

@@ -1,21 +0,0 @@
# This composition can be used to serve up the rendered mkdocs for local authoring.
#
# docker compose -f docker-compose-mkdocs.yml -p mkdocs up
#
# and then access http://localhost:8000
version: "3.8"
services:
mkdocs:
build:
context: .
dockerfile: docs/Dockerfile
volumes:
- ./mkdocs.yml:/mkdocs/mkdocs.yml
- ./docs:/mkdocs/docs
command:
- serve
- --dev-addr=0.0.0.0:8000
ports:
- "8000:8000"

View File

@@ -1,16 +1,16 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "true"
ports:
- "25565:25565"
volumes:
- data:/data
stdin_open: true
tty: true
restart: unless-stopped
volumes:
data: {}
version: '3'
# Other docker-compose examples in /examples
services:
minecraft:
image: itzg/minecraft-server
ports:
- "25565:25565"
volumes:
- "mc:/data"
environment:
EULA: "TRUE"
restart: always
volumes:
mc: {}

133
docker-versions-create.sh Executable file
View File

@@ -0,0 +1,133 @@
#!/bin/bash
#set -x
# Use this variable to indicate a list of branches that docker hub is watching
branches_list=(
'java8'
'java8-multiarch'
'java8-openj9'
'java11'
'java11-openj9'
'java16'
'java16-openj9'
'multiarch-latest'
)
function TrapExit {
echo "Checking out back in master"
git checkout master
}
batchMode=false
while getopts "hbt:s" arg
do
case $arg in
b)
batchMode=true
;;
t)
tag=${OPTARG}
;;
s)
tagArgs="-s -m 'Signed during docker-versions-create"
;;
h)
echo "
Usage $0 [options]
Options:
-b enable batch mode, which avoids interactive prompts and causes script to fail immediately
when any merge fails
-t TAG tag and push the current revision on master with the given tag
and apply respective tags to each branch
-s enable signed tags
-h display this help and exit
"
exit
;;
*)
echo "Unsupported arg $arg"
exit 2
;;
esac
done
${batchMode} && echo "Using batch mode"
trap TrapExit EXIT SIGTERM
test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!";
exit 1; }
# Making sure we are in master
git checkout master
git pull --all || { echo "Can't pull the repo!"; \
exit 1; }
if [[ $tag ]]; then
git tag $tag
git push origin $tag
fi
git_branches=$(git branch -a)
for branch in "${branches_list[@]}"; do
if [[ "$git_branches" != *"$branch"* ]]; then
echo "Can't update $branch because I can't find it in the list of branches."
exit 1
else
echo "Branch $branch found. Working with it."
git checkout "$branch" || { echo "Can't checkout into the branch. Don't know the cause."; \
exit 1; }
proceed='False'
while [[ "$proceed" == "False" ]]; do
# Ensure local branch is aligned with remote since docker-versions-create may have been run elsewhere
git pull
if git merge -m 'Auto-merging via docker-versions-create' master; then
proceed="True"
echo "Branch $branch updated to current master successfully"
# pushing changes to remote for this branch
git commit -m "Auto merge branch with master" -a
# push may fail if remote doesn't have this branch yet. In this case - sending branch
git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
if [[ $tag ]]; then
git tag "$tag-$branch"
git push origin "$tag-$branch"
fi
elif ${batchMode}; then
status=$?
echo "Git merge failed in batch mode"
exit ${status}
# and trap exit gets us back to master
else
cat<<EOL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Master merge in the branch $branch encountered an error!
You may try to fix the error and merge again. (Commit changes)
Or skip this branch merge completely.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EOL
printf "Should we try again? (y):"
read -r answer
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
# If you use non-local editor or files are changed in repo
cat <<EOL
The following commands may encounter an error!
This is completely fine if the changes were made locally and remote branch doesn't know about them.
EOL
# Updating branch from remote before trying again
git checkout master
git fetch --all
git pull -a
git checkout "$branch"
continue
else
break
fi
fi
done
fi
done

View File

@@ -1,10 +0,0 @@
FROM python:3.8
RUN pip install --upgrade pip
WORKDIR /mkdocs
RUN --mount=target=/build/requirements.txt,source=docs/requirements.txt \
pip install -r /build/requirements.txt
ENTRYPOINT ["mkdocs"]

View File

@@ -1,45 +0,0 @@
---
title: Sending commands
---
[RCON](http://wiki.vg/RCON) is enabled by default, so you can `exec` into the container to
access the Minecraft server console:
```
docker exec -i mc rcon-cli
```
Note: The `-i` is required for interactive use of rcon-cli.
To run a simple, one-shot command, such as stopping a Minecraft server, pass the command as arguments to `rcon-cli`, such as:
```
docker exec mc rcon-cli stop
```
_The `-i` is not needed in this case._
If rcon is disabled you can send commands by passing them as arguments to the packaged `mc-send-to-console` script. For example, a player can be op'ed in the container `mc` with:
```shell
docker exec mc mc-send-to-console op player
| |
+- container name +- Minecraft commands start here
```
In order to attach and interact with the Minecraft server, add `-it` when starting the container, such as
docker run -d -it -p 25565:25565 --name mc itzg/minecraft-server
With that you can attach and interact at any time using
docker attach mc
and then Control-p Control-q to **detach**.
For remote access, configure your Docker daemon to use a `tcp` socket (such as `-H tcp://0.0.0.0:2375`)
and attach from another machine:
docker -H $HOST:2375 attach mc
Unless you're on a home/private LAN, you should [enable TLS access](https://docs.docker.com/articles/https/).

View File

@@ -1,71 +0,0 @@
# Auto-execute RCON commands
RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects.
!!! note
When declaring several commands within a compose file environment variable, it's easiest to use YAML's `|-` [block style indicator](https://yaml-multiline.info/).
**On Server Start:**
``` yaml
RCON_CMDS_STARTUP: |-
gamerule doFireTick false
pregen start 200
```
**On Client Connection:**
``` yaml
RCON_CMDS_ON_CONNECT: |-
team join New @a[team=]
```
**Note:**
* On client connect we only know there was a connection, and not who connected. RCON commands will need to be used for that.
**On Client Disconnect:**
``` yaml
RCON_CMDS_ON_DISCONNECT: |-
gamerule doFireTick true
```
**On First Client Connect**
``` yaml
RCON_CMDS_FIRST_CONNECT: |-
pregen stop
```
**On Last Client Disconnect**
``` yaml
RCON_CMDS_LAST_DISCONNECT: |-
kill @e[type=minecraft:boat]
pregen start 200
```
**Example of rules for new players**
Uses team NEW and team OLD to track players on the server. So move player with no team to NEW, run a command, move them to team OLD.
[Reference Article](https://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/2213523-detect-players-first-join)
``` yaml
RCON_CMDS_STARTUP: |-
/pregen start 200
/gamerule doFireTick false
/team add New
/team add Old
RCON_CMDS_ON_CONNECT: |-
/team join New @a[team=]
/give @a[team=New] birch_boat
/team join Old @a[team=New]
RCON_CMDS_FIRST_CONNECT: |-
/pregen stop
RCON_CMDS_LAST_DISCONNECT: |-
/kill @e[type=minecraft:boat]
/pregen start 200
```

View File

@@ -1,142 +0,0 @@
---
title: Modifying config files
---
## 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.
When the environment variable `REPLACE_ENV_IN_PLACE` is set to `true` (the default), the startup script will go through all files inside the container's `/data` path and replace variables that match the container's environment variables. Variables can instead (or in addition to) be replaced in files sync'ed from `/plugins`, `/mods`, and `/config` by setting `REPLACE_ENV_DURING_SYNC` to `true` (defaults to `false`).
Variables that you want to replace need to be declared inside curly brackets and prefixed with a dollar sign, such as `${CFG_YOUR_VARIABLE}`, which is same as many scripting languages.
You can also change `REPLACE_ENV_VARIABLE_PREFIX`, which defaults to "CFG_", to limit which environment variables are allowed to be used. For example, with "CFG_" as the prefix, the variable `${CFG_DB_HOST}` would be substituted, but not `${DB_HOST}`. The prefix can be set to an empty string to allow for matching any variable name.
If you want to use a file's content for value, such as when using secrets mounted as files, declare the placeholder named like normal in the file and declare an environment variable named the same but with the suffix `_FILE`.
For example, a `my.cnf` file could contain:
```
[client]
password = ${CFG_DB_PASSWORD}
```
...a secret declared in the compose file with:
```yaml
secrets:
db_password:
external: true
```
...and finally the environment variable would be named with a `_FILE` suffix and point to the mounted secret:
```yaml
environment:
CFG_DB_PASSWORD_FILE: /run/secrets/db_password
```
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"
volumes:
mc:
rcon:
secrets:
db_password:
file: ./db_password
```
## Patching existing files
JSON path based patches can be applied to one or more existing files by setting the variable `PATCH_DEFINITIONS` to the path of a directory that contains one or more [patch definition json files](https://github.com/itzg/mc-image-helper#patchdefinition) or a [patch set json file](https://github.com/itzg/mc-image-helper#patchset).
Variable placeholders in the patch values can be restricted by setting `REPLACE_ENV_VARIABLE_PREFIX`, which defaults to "CFG_".
The following example shows a patch-set file were various fields in the `paper.yaml` configuration file can be modified and added:
```json
{
"patches": [
{
"file": "/data/paper.yml",
"ops": [
{
"$set": {
"path": "$.verbose",
"value": true
}
},
{
"$set": {
"path": "$.settings['velocity-support'].enabled",
"value": "${CFG_VELOCITY_ENABLED}",
"value-type": "bool"
}
},
{
"$put": {
"path": "$.settings",
"key": "my-test-setting",
"value": "testing"
}
}
]
}
]
}
```
> **NOTES:** Only JSON and Yaml files can be patched at this time. TOML support is planned to be added next. Removal of comments and other cosmetic changes will occur when patched files are processed.

View File

@@ -1,77 +0,0 @@
# JVM Options
## Memory Limit
By default, the image declares an initial and maximum Java memory-heap limit of 1 GB. There are several ways to adjust the memory settings:
- `MEMORY`: "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) memory heap settings of the JVM
- `INIT_MEMORY`: independently sets the initial heap size
- `MAX_MEMORY`: independently sets the max heap size
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`. For example:
-e MEMORY=2G
To let the JVM calculate the heap size from the container declared memory limit, unset `MEMORY` with an empty value, such as `-e MEMORY=""`. By default, the JVM will use 25% of the container memory limit as the heap limit; however, as an example the following would tell the JVM to use 75% of the container limit of 2GB of memory:
-e MEMORY="" -e JVM_XX_OPTS="-XX:MaxRAMPercentage=75" -m 2000M
!!! important
The settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).
## Extra JVM Options
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
environment variable. The JVM requires `-XX` options to precede `-X` options, so those can be declared in `JVM_XX_OPTS`. Both variables are space-delimited, raw JVM arguments.
```
docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ...
```
**NOTE** When declaring `JVM_OPTS` in a compose file's `environment` section with list syntax, **do not** include the quotes:
```yaml
environment:
- EULA=true
- JVM_OPTS=-someJVMOption someJVMOptionValue
```
Using object syntax is recommended and more intuitive:
```yaml
environment:
EULA: "true"
JVM_OPTS: "-someJVMOption someJVMOptionValue"
# or
# JVM_OPTS: -someJVMOption someJVMOptionValue
```
As a shorthand for passing several system properties as `-D` arguments, you can instead pass a comma separated list of `name=value` or `name:value` pairs with `JVM_DD_OPTS`. (The colon syntax is provided for management platforms like Plesk that don't allow `=` inside a value.)
For example, instead of passing
```yaml
JVM_OPTS: -Dfml.queryResult=confirm -Dname=value
```
you can use
```yaml
JVM_DD_OPTS: fml.queryResult=confirm,name=value
```
## Enable Remote JMX for Profiling
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true`, set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
```
-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091
```
## Enable Aikar's Flags
[Aikar has done some research](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/) into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrently. The set of flags documented there can be added using
-e USE_AIKAR_FLAGS=true
When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article.

View File

@@ -1,156 +0,0 @@
## 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
By default, the container will switch to user ID 1000 and group ID 1000;
however, you can override those values by setting `UID` and/or `GID` as environmental entries, during the `docker run` command.
-e UID=1234
-e GID=1234
The container will also skip user switching if the `--user`/`-u` argument
is passed to `docker run`.
## Extra Arguments
Arguments that would usually be passed to the jar file (those which are written after the filename) can be passed via the `EXTRA_ARGS` environment variable.
See [Custom worlds directory path](../misc/world-data.md#custom-worlds-directory-path) for an example.
## 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.
>
> This feature is incompatible with Autopause and cannot be set when `ENABLE_AUTOPAUSE=true`.
## Server Shutdown Options
To allow time for players to finish what they're doing during a graceful server shutdown, set `STOP_SERVER_ANNOUNCE_DELAY` to a number of seconds to delay after an announcement is posted by the server.
> **NOTE** be sure to adjust Docker's shutdown timeout accordingly, such as using [the -t option on docker-compose down](https://docs.docker.com/compose/reference/down/).
## 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
You can configure the timezone to match yours by setting the `TZ` environment variable:
-e TZ=Europe/London
such as:
docker run -d -it -e TZ=Europe/London -p 25565:25565 --name mc itzg/minecraft-server
Or mounting `/etc/timezone` as readonly (not supported on Windows):
-v /etc/timezone:/etc/timezone:ro
such as:
docker run -d -it -v /etc/timezone:/etc/timezone:ro -p 25565:25565 --name mc itzg/minecraft-server
## HTTP Proxy
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
environment variable. In [the example compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-proxied.yml) it references
a companion squid proxy by setting the equivalent of
-e PROXY=proxy:3128
## Using "noconsole" option
Some older versions (pre-1.14) of Spigot required `--noconsole` to be passed when detaching stdin, which can be done by setting `-e CONSOLE=FALSE`.
## Explicitly disable GUI
Some older servers get confused and think that the GUI interface is enabled. You can explicitly
disable that by passing `-e GUI=FALSE`.
## 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.
## Setup only
If you are using a host-attached data directory, then you can have the image setup the Minecraft server files and stop prior to launching the server process by setting `SETUP_ONLY` to `true`.
## Enable Flare Flags
To enable the JVM flags required to fully support the [Flare profiling suite](https://blog.airplane.gg/flare), set the following variable:
-e USE_FLARE_FLAGS=true
Flare is built-in to Pufferfish/Purpur, and is available in [plugin form](https://github.com/TECHNOVE/FlarePlugin) for other server types.
## Enable support for optimized SIMD operations
To enable support for optimized SIMD operations, the JVM flag can be set with the following variable:
-e USE_SIMD_FLAGS=true
SIMD optimized operations are supported by Pufferfish and Purpur.
## Enable timestamps in init logs
Before the container starts the Minecraft Server its output is prefixed with `[init]`, such as
```
[init] Starting the Minecraft server...
```
To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The log output will then look like:
```
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
```

View File

@@ -1,337 +0,0 @@
By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed.
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".
> NOTE: to clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. A variables that maps to a server property that is unset, is ignored and the existing `server.property` is left unchanged.
### Message of the Day
The message of the day, shown below each server entry in the client UI, can be changed with the `MOTD` environment variable, such as
-e MOTD="My Server"
If you leave it off, a default is computed from the server type and version, such as
A Paper Minecraft Server powered by Docker
That way you can easily differentiate between several servers you may have started.
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes) to be used consistently with all server versions. For example,
-e MOTD="A §l§cMinecraft§r §nserver"
renders
![](../img/motd-example.png)
To produce a multi-line MOTD, you will need to double escape the newline such as
-e MOTD="Line one\\nLine two"
### Difficulty
The difficulty level (default: `easy`) can be set like:
```
docker run -d -e DIFFICULTY=hard ...
```
Valid values are: `peaceful`, `easy`, `normal`, and `hard`, and an
error message will be output in the logs if it's not one of these
values.
### Whitelist Players
!!! note
It is very important to set this with servers exposed to the internet where you want only limited players to join.
To whitelist players for your Minecraft server, you can:
- Provide a list of usernames and/or UUIDs separated by commas via the `WHITELIST` environment variable
`docker run -d -e WHITELIST=user1,uuid2 ...`
- Provide the url or path to a whitelist file via `WHITELIST_FILE` environment variable
`docker run -d -e WHITELIST_FILE=/extra/whitelist.json ...`
When either is set, [whitelisting of connecting users](https://minecraft.fandom.com/wiki/Server.properties#white-list) is enabled . If managing the list manually, `ENABLE_WHITELIST` can be set to "true" to set the `white-list` property.
If whitelist configuration already exists, `WHITELIST_FILE` will not be retrieved and any usernames in `WHITELIST` are **added** to the whitelist configuration. You can enforce regeneration of the whitelist on each server startup by setting `OVERRIDE_WHITELIST` to "true". This will delete the whitelist file before processing whitelist configuration.
!!! note
You can provide both `WHITELIST_FILE` and `WHITELIST`, which are processed in that order.
!!! note
UUIDs passed via `WHITELIST` need to be the dashed variant, otherwise it not be recognised and instead added as a username.
If running Minecraft 1.7.5 or earlier, these variables will apply to `white-list.txt`, with 1.7.6 implementing support for `whitelist.json`. Make sure your `WHITELIST_FILE` is in the appropriate format.
To [enforce the whitelist changes immediately](https://minecraft.fandom.com/wiki/Server.properties#enforce-whitelist) when whitelist commands are used , set `ENFORCE_WHITELIST` to "true".
### Op/Administrator Players
Similar to the whitelist, to add users as operators (aka adminstrators) to your Minecraft server, you can:
- Provide te url or path to an ops file via `OPS_FILE` environment variable
`docker run -d -e OPS_FILE=https://config.example.com/extra/ops.json ...`
- Provide a list of usernames and/or UUIDs separated by commas via the `OPS` environment variable
`docker run -d -e OPS=user1,uuid2 ...`
If ops configuration already exists, `OPS_FILE` will not be retrieved and any usernames in `OPS` are **added** to the ops configuration. You can enforce regeneration of the ops configuration on each server startup by setting `OVERRIDE_OPS` to "true". This will delete the ops file before processing ops configuration.
!!! note
Similar to whitelists, you can provide both `OPS_FILE` and `OPS`, and Minecraft 1.7.5 or earlier will use `ops.txt` rather than `ops.json`.
### Enable/disable initial selection of datapacks
New to [22W42A](https://www.minecraft.net/en-us/article/minecraft-snapshot-22w42a), datapacks with feature flags can be controlled before initial world creation by setting these to a comma separated list of packs:
- `INITIAL_ENABLED_PACKS`
such as "update_1_20,bundle"
- `INITIAL_DISABLED_PACKS`
### Server icon
A server icon can be configured using the `ICON` variable. The image will be automatically
downloaded, scaled, and converted from any other image format:
docker run -d -e ICON=http://..../some/image.png ...
The server icon which has been set doesn't get overridden by default. It can be changed and overridden by setting `OVERRIDE_ICON` to `TRUE`.
docker run -d -e ICON=http://..../some/other/image.png -e OVERRIDE_ICON=TRUE...
### RCON
RCON is **enabled by default** to allow for graceful shut down the server and coordination of save state during backups. RCON can be disabled by setting `ENABLE_RCON` to "false".
The default password is randomly generated if `RCON_PASSWORD` has not been set.
**DO NOT MAP THE RCON PORT EXTERNALLY** unless you aware of all the consequences and have set a **secure password** with `RCON_PASSWORD`.
!!! info
Mapping ports (`-p` command line or `ports` in compose) outside the container and docker networking needs to be a purposeful choice. Most production Docker deployments do not need any of the Minecraft ports mapped externally from the server itself.
By default, the server listens for RCON on port 25575 within the container. It can be changed with `RCON_PORT` but only do this if you have a very good reason. **DO NOT change `rcon.port` via `server.properties`** or integrations will break.
### Query
Enabling this will enable the gamespy query protocol.
By default the query port will be `25565` (UDP) but can easily be changed with the `QUERY_PORT` variable.
docker run -d -e ENABLE_QUERY=true
### Max players
By default max players is 20, you can increase this with the `MAX_PLAYERS` variable.
docker run -d -e MAX_PLAYERS=50
### Max world size
This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
docker run -d -e MAX_WORLD_SIZE=10000
### Allow Nether
Allows players to travel to the Nether.
docker run -d -e ALLOW_NETHER=true
### Announce Player Achievements
Allows server to announce when a player gets an achievement.
docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true
### Enable Command Block
Enables command blocks
docker run -d -e ENABLE_COMMAND_BLOCK=true
### Force Gamemode
Force players to join in the default game mode.
- false - Players will join in the gamemode they left in.
- true - Players will always join in the default gamemode.
`docker run -d -e FORCE_GAMEMODE=false`
### Generate Structures
Defines whether structures (such as villages) will be generated.
- false - Structures will not be generated in new chunks.
- true - Structures will be generated in new chunks.
`docker run -d -e GENERATE_STRUCTURES=true`
### Hardcore
If set to true, players will be set to spectator mode if they die.
docker run -d -e HARDCORE=false
### Snooper
If set to false, the server will not send data to snoop.minecraft.net server.
docker run -d -e SNOOPER_ENABLED=false
### Max Build Height
The maximum height in which building is allowed.
Terrain may still naturally generate above a low height limit.
docker run -d -e MAX_BUILD_HEIGHT=256
### Max Tick Time
The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message, A single server tick took 60.00 seconds (should be max 0.05); Considering it to be crashed, server will forcibly shutdown. Once this criteria is met, it calls System.exit(1).
Setting this to -1 will disable watchdog entirely
docker run -d -e MAX_TICK_TIME=60000
### Spawn Animals
Determines if animals will be able to spawn.
docker run -d -e SPAWN_ANIMALS=true
### Spawn Monsters
Determines if monsters will be spawned.
docker run -d -e SPAWN_MONSTERS=true
### Spawn NPCs
Determines if villagers will be spawned.
docker run -d -e SPAWN_NPCS=true
### Set spawn protection
Sets the area that non-ops can not edit (0 to disable)
docker run -d -e SPAWN_PROTECTION=0
### View Distance
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
It determines the server-side viewing distance.
docker run -d -e VIEW_DISTANCE=10
### Level Seed
If you want to create the Minecraft level with a specific seed, use `SEED`, such as
-e SEED=1785852800490497919
If using a negative value for the seed, make sure to quote the value such as:
-e SEED="-1785852800490497919"
### Game Mode
By default, Minecraft servers are configured to run in Survival mode. You can
change the mode using `MODE` where you can either provide the [standard
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
shortcut values:
- creative
- survival
- adventure
- spectator (only for Minecraft 1.8 or later)
For example:
docker run -d -e MODE=creative ...
### PVP Mode
By default, servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
environment variable set to `false`, such as
docker run -d -e PVP=false ...
### Level Type and Generator Settings
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.fandom.com/wiki/Server.properties#level-type).
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.fandom.com/wiki/Server.properties#generator-settings).
### Custom Server Resource Pack
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
docker run -d -e 'RESOURCE_PACK=http://link.com/to/pack.zip?=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0'
You can enforce the resource pack on clients by setting `RESOURCE_PACK_ENFORCE` to `TRUE` (default: `FALSE`).
### Level / World Save Name
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
where the default is "world":
docker run -d -e LEVEL=bonus ...
> **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.
> **INFO** Refer to the [data directory](../data-directory.md) section for a visual description of where the `$LEVEL` directory is situated.
### Online mode
By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players with environment variable `ONLINE_MODE`, like this
docker run -d -e ONLINE_MODE=FALSE ...
### Allow flight
Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.
-e ALLOW_FLIGHT=TRUE|FALSE
### Server name
The server name (e.g. for bungeecord) can be set like:
docker run -d -e SERVER_NAME=MyServer ...
### Server port
> **WARNING:** only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used. Use `-p` port mappings instead.
If you must, the server port can be set like:
docker run -d -e SERVER_PORT=25566 ...
**however**, be sure to change your port mapping accordingly and be prepared for some features to break.
### Other server property mappings
| Environment Variable | Server Property |
| --------------------------------- | --------------------------------- |
| BROADCAST_CONSOLE_TO_OPS | broadcast-console-to-ops |
| BROADCAST_RCON_TO_OPS | broadcast-rcon-to-ops |
| ENABLE_STATUS | enable-status |
| ENFORCE_SECURE_PROFILE | enforce-secure-profile |
| ENTITY_BROADCAST_RANGE_PERCENTAGE | entity-broadcast-range-percentage |
| FUNCTION_PERMISSION_LEVEL | function-permission-level |
| NETWORK_COMPRESSION_THRESHOLD | network-compression-threshold |
| OP_PERMISSION_LEVEL | op-permission-level |
| PLAYER_IDLE_TIMEOUT | player-idle-timeout |
| PREVENT_PROXY_CONNECTIONS | prevent-proxy-connections |
| SIMULATION_DISTANCE | simulation-distance |
| SYNC_CHUNK_WRITES | sync-chunk-writes |
| USE_NATIVE_TRANSPORT | use-native-transport |

View File

@@ -1,89 +0,0 @@
Everything the container manages is located under the **container's** `/data` path, as shown here:
![](img/level-vs-world.drawio.png)
!!! note
The container path `/data` is pre-declared as a volume, so if you do nothing then it will be allocated as an anonymous volume. As such, it is subject to removal when the container is removed.
### Attaching data directory to host filesystem
In most cases the easiest way to persist and work with the minecraft data files is to use [bind mounts](https://docs.docker.com/storage/bind-mounts/) with the `-v` argument to map a directory on your host machine to the container's `/data` directory. In the following example, the path `/home/user/minecraft-data` **must be** a directory on your host machine:
-v /home/user/minecraft-data:/data
------------------------- -----
| |
| +-- must always be /data
|
+-- replace with a directory on your host machine
When attached in this way you can stop the server, edit the configuration under your attached directory and start the server again to pick up the new configuration.
!!! important "Rootless, Podman, SELinux, AppArmor usage"
When running rootless containers, such as with Podman, or using SELinux / AppArmor on your system, append ":Z" to the volume mapping. For example:
```
/home/user/minecraft-data:/data:Z
```
There might be a safer/better way to accommodate these systems. Please post an issue or PR if you have more information.
With Docker Compose, setting up a host attached directory is even easier since relative paths can be configured. For example, with the following `docker-compose.yml` Docker will automatically create/attach the relative directory `minecraft-data` to the container.
``` yaml title="docker-compose.yml"
version: "3"
services:
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
tty: true
stdin_open: true
restart: unless-stopped
volumes:
# attach a directory relative to the directory containing this compose file
- ./minecraft-data:/data
```
### Converting anonymous `/data` volume to named volume
If you had used the commands in the first section, without the `-v` volume attachment, then an anonymous data volume was created by Docker. You can later bring over that content to a named or host attached volume using the following procedure.
!!! note
In this example, it is assumed the original container was given a `--name` of "mc", so change the container identifier accordingly.
You can also locate the Docker-managed directory from the `Source` field obtained from `docker inspect <container id or name> -f "{{json .Mounts}}"`
First, stop the existing container:
``` shell
docker stop mc
```
Use a temporary container to copy over the anonymous volume's content into a named volume, "mc" in this case:
``` shell
docker run --rm --volumes-from mc -v mc:/new alpine cp -avT /data /new
```
Now you can recreate the container with any environment variable changes, etc by attaching the named volume created from the previous step:
``` shell
docker run -d -it --name mc-new -v mc:/data -p 25565:25565 -e EULA=TRUE -e MEMORY=2G itzg/minecraft-server
```
### Locating filesystem path of anonymous volume
The `Source` field from the output of this command will show where the anonymous volume is mounted from:
``` shell
docker inspect -f "{{json .Mounts}}" CONTAINER_NAME_OR_ID
```
!!! note
On Windows with WSL the volumes path is `\\wsl$\docker-desktop-data\data\docker\volumes`

1
docs/img/.gitignore vendored
View File

@@ -1 +0,0 @@
/.*.bkp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,12 +0,0 @@
Generated at https://textcraft.net/
Line 1:
"Click here for"
Small, none, Minecraftia
Line 2:
"Documentation"
Large, non, Minecrafter
Overall settings:
- drop shadow

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -1,66 +0,0 @@
# Intro
[![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/)
[![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/)
[![GitHub Issues](https://img.shields.io/github/issues-raw/itzg/docker-minecraft-server.svg)](https://github.com/itzg/docker-minecraft-server/issues)
[![Discord](https://img.shields.io/discord/660567679458869252?label=Discord&logo=discord)](https://discord.gg/DXfKpjB)
[![Build and Publish](https://github.com/itzg/docker-minecraft-server/workflows/Build%20and%20Publish/badge.svg)](https://github.com/itzg/docker-minecraft-server/actions)
[![](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-orange.svg)](https://www.buymeacoffee.com/itzg)
This docker image provides a Minecraft Server that will automatically download the latest stable
version at startup. You can also run/upgrade to any specific version or the
latest snapshot. See the _Versions_ section below for more information.
To simply use the latest stable version, run
docker run -d -it -p 25565:25565 -e EULA=TRUE itzg/minecraft-server
where, in this case, the standard server port 25565, will be exposed on your host machine.
!!! note
If you plan on running a server for a longer amount of time it is highly recommended using a management layer such as [Docker Compose](#using-docker-compose) or [Kubernetes](#deployment-templates-and-examples) to allow for incremental reconfiguration and image upgrades.
!!! info
Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
!!! warning
**DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
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/java.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
## Using [Docker Compose](https://docs.docker.com/compose/)
1. Create a new directory
2. Put the contents of the file below in a file called `docker-compose.yml`
3. Run `docker compose up -d` in that directory
4. Done! Point your client at your host's name/IP address and port 25565.
```yaml
version: "3.8"
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data
```
To apply changes made to the compose file, just run `docker compose up -d` again.
Follow the logs of the container using `docker compose logs -f`, check on the status with `docker compose ps`, and stop the container using `docker compose stop`.
!!! note "More Compose Examples"
There are more [examples located in the Github repo](https://github.com/itzg/docker-minecraft-server/tree/master/examples).
!!! note "Deployment Examples"
The [deployments page](misc/deployment/index.md) provides more examples of deployment with and beyond Docker Compose.

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,61 +0,0 @@
# Auto-Pause
An auto-pause functionality is provided that monitors whether clients are connected to the server. If a client is not connected for a specified time, the Java process is put into a pause state. When a client attempts to connect while the process is paused, then process will be restored to a running state. The experience for the client does not change. This feature can be enabled by setting the environment variable `ENABLE_AUTOPAUSE` to "true".
!!! important
**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](../../configuration/server-properties.md#max-tick-time).
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`
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.
The utility used to wake the server (`knock(d)`) works at network interface level. So the correct interface has to be set using the `AUTOPAUSE_KNOCK_INTERFACE` variable when using non-default networking environments (e.g. host-networking, Portainer oder NAS solutions). See the description of the variable below.
A file called `.paused` is created in `/data` directory when the server is paused and removed when the server is resumed. Other services may check for this file's existence before waking the server.
A `.skip-pause` file can be created in the `/data` directory to make the server skip autopausing, for as long as the file is present. The autopause timer will also be reset.
A starting, example compose file has been provided in [examples/docker-compose-autopause.yml](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-autopause.yml).
Auto-pause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
!!! note
When configuring kubernetes readiness/liveness health checks with auto-pause enabled, be sure to reference the `mc-health` wrapper script rather than `mc-status` directly.
## Additional configuration
The following environment variables define the behaviour of auto-pausing:
- `AUTOPAUSE_TIMEOUT_EST`, default `3600` (seconds)
describes the time between the last client disconnect and the pausing of the process (read as timeout established)
- `AUTOPAUSE_TIMEOUT_INIT`, default `600` (seconds)
describes the time between server start and the pausing of the process, when no client connects inbetween (read as timeout initialized)
- `AUTOPAUSE_TIMEOUT_KN`, default `120` (seconds)
describes the time between knocking of the port (e.g. by the main menu ping) and the pausing of the process, when no client connects inbetween (read as timeout knocked)
- `AUTOPAUSE_PERIOD`, default `10` (seconds)
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
!!! tip
To troubleshoot, add `DEBUG_AUTOPAUSE=true` to see additional output
## Rootless Auto-Pause
If you're running the container as rootless, you might need to set change the default port forwarder from RootlessKit to slirp4netns.
For Docker, see the following for setup:
- https://docs.docker.com/engine/security/rootless/#networking-errors
- https://rootlesscontaine.rs/getting-started/docker/#changing-the-port-forwarder
For Podman, see the following for setup:
- https://rootlesscontaine.rs/getting-started/podman/#changing-the-port-forwarder
- Run with
```
-e AUTOPAUSE_KNOCK_INTERFACE=tap0 --cap-add=CAP_NET_RAW --network slirp4netns:port_handler=slirp4netns
```

View File

@@ -1,27 +0,0 @@
# Auto-Stop
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
!!! note
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
A `.skip-stop` file can be created in the `/data` directory to make the server skip autostopping, for as long as the file is present. The autostop timer will also be reset.
A starting, example compose file has been provided in [examples/docker-compose-autostop.yml](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-autostop.yml).
Enable the Autostop functionality by setting:
```
-e ENABLE_AUTOSTOP=TRUE
```
The following environment variables define the behavior of auto-stopping:
* `AUTOSTOP_TIMEOUT_EST`, default `3600` (seconds)
describes the time between the last client disconnect and the stopping of the server (read as timeout established)
* `AUTOSTOP_TIMEOUT_INIT`, default `1800` (seconds)
describes the time between server start and the stopping of the server, when no client connects in-between (read as timeout initialized)
* `AUTOSTOP_PERIOD`, default `10` (seconds)
describes period of the daemonized state machine, that handles the stopping of the server
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output

View File

@@ -1,28 +0,0 @@
## Building image locally with alternate Java base
The following shows how to change the base Java image used by the build:
```shell
docker build --build-arg BASE_IMAGE=ghcr.io/graalvm/graalvm-ce:ol8-java11 -t IMG_PREFIX/minecraft-server:java11-graalvm .
```
## Building a multi-architecture image
Ensure buildx/BuildKit support is enabled and run the following to build multi-architecture and push to the repository as named by the image:
```shell
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag IMG_PREFIX/minecraft-server --push .
```
To build for local images, multi-architecture is not supported, use the following with buildx to load the image into the local daemon:
```shell
docker buildx build --tag IMG_PREFIX/minecraft-server --load .
```
or just a plain build
```shell
docker build -t IMG_PREFIX/minecraft-server .
```

View File

@@ -1,101 +0,0 @@
## Adding a server type
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
1. Copy an existing "start-deploy*" script, such as [start-deployFabric](https://github.com/itzg/docker-minecraft-server/blob/master/scripts/start-deployFabric) and rename it accordingly making sure to retain the "start-deploy" prefix
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-setupWorld` at the end of the script
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](https://github.com/itzg/docker-minecraft-server/blob/master/scripts/start-configuration)
5. Add a section to the [docs](https://github.com/itzg/docker-minecraft-server/tree/master/docs). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
6. [Submit a pull request](https://github.com/itzg/docker-minecraft-server/pulls)
## Iterative script development
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
First, build a baseline of the image to include the packages needed by existing or new scripts:
PowerShell: (Example of building and testing ForgeAPI)
```powershell
$env:MODS_FORGEAPI_KEY='$2a$...'
$env:FOLDER_TO_TEST="forgeapimods_projectids"
$env:IMAGE_TO_TEST="mc-dev"
docker build -t $env:IMAGE_TO_TEST .
pushd "tests/setuponlytests/$env:FOLDER_TO_TEST/"
docker-compose run mc
docker-compose down -v --remove-orphans
popd
```
PowerShell: Building different images of Java for testing
```powershell
$env:BASE_IMAGE='eclipse-temurin:8u312-b07-jre'
$env:IMAGE_TO_TEST="mc-dev"
docker build --build-arg BASE_IMAGE=$env:BASE_IMAGE -t $env:IMAGE_TO_TEST .
```
Bash: (Example of building and testing ForgeAPI)
```bash
export MODS_FORGEAPI_KEY='$2a$...'
export FOLDER_TO_TEST="forgeapimods_file"
export IMAGE_TO_TEST="mc-dev"
docker build -t $IMAGE_TO_TEST .
pushd tests/setuponlytests/$FOLDER_TO_TEST/
docker-compose run mc
docker-compose down -v --remove-orphans
popd
```
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
```shell script
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
```
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
```shell script
export VERSION=1.12.2
/scripts/start-magma
```
...or pre-pending script execution:
```shell script
VERSION=1.12.2 /scripts/start-magma
```
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
## Using development copy of mc-image-helper
In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
```shell
./gradlew distTar
```
!!! note
The distribution's version will be `0.0.0-<branch>-SNAPSHOT`
Assuming Java 18 or newer:
```shell
cd build/distributions
jwebserver -b 0.0.0.0 -p 8008
```
```shell
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
```
Now the image can be built like normal, and it will install mc-image-helper from the locally built copy.
## Generating release notes
The following git command can be used to provide the bulk of release notes content:
```shell script
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="* %s" 1.1.0..1.2.0
```

View File

@@ -1,16 +0,0 @@
# Site documentation
The documentation for this image/repository is written in markdown and built by [MkDocs](https://www.mkdocs.org/) into a documentation website hosted at [Read the Docs](https://readthedocs.org/). [Here is general information about writing MkDocs markdown](https://www.mkdocs.org/user-guide/writing-your-docs/) and [specifics for the Material theme used](https://squidfunk.github.io/mkdocs-material/reference/).
!!! note
The README.md rarely needs to be modified and only serves as a brief introduction to the project.
The documentation source is maintained in the [docs](https://github.com/itzg/docker-minecraft-server/tree/master/docs) folder and is organized into sections by directory and files. Look through the existing content to determine if an existing file should be updated or a new file/directory added.
It will be very helpful to view the rendered documentation as you're editing. To do that run the following from the top-level directory:
```shell
docker compose -f docker-compose-mkdocs.yml -p mkdocs up
```
You can access the live documentation rendering at <http://localhost:8000>.

View File

@@ -1,22 +0,0 @@
# More Deployment Info
## Using Helm
- itzg Helm Chart:
- [GitHub repo](https://github.com/itzg/minecraft-server-charts)
- [Helm Chart repo](https://itzg.github.io/minecraft-server-charts/)
- [mcsh/server-deployment](https://github.com/mcserverhosting-net/charts)
## Supporting Articles
Below are supporting articles for server deployment.
- "Zero to Minecraft Server with Docker Desktop and Compose"
https://dev.to/rela-v/zero-to-minecraft-server-with-docker-desktop-and-compose-500a
- This is a reference guide/tutorial on how to set up a vanilla Minecraft server using this project, including step-by-step instructions, and information on topics such as port-forwarding.
## Deploying onto AWS
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.

View File

@@ -1,27 +0,0 @@
## Healthcheck
This image contains [mc-monitor](https://github.com/itzg/mc-monitor) and uses its `status` command to continually check on the container's. That can be observed from the `STATUS` column of `docker ps`
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b418af073764 mc "/start" 43 seconds ago Up 41 seconds (healthy) 0.0.0.0:25565->25565/tcp, 25575/tcp mc
```
You can also query the container's health in a script friendly way:
``` shell
> docker container inspect -f "{{.State.Health.Status}}" mc
healthy
```
There's actually a wrapper script called `mc-health` that takes care of calling `mc-monitor status` with the correct arguments. If needing to customize the health checks parameters, such as in a compose file, then use something like the following in the service declaration:
``` yaml
healthcheck:
test: mc-health
start_period: 1m
interval: 5s
retries: 20
```
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.

View File

@@ -1 +0,0 @@
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.

View File

@@ -1,11 +0,0 @@
# 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](../versions/java.md) that specify `armv7` for the architecture, which includes `itzg/minecraft-server:latest`.
!!! note
You may need to lower the memory allocation, such as `-e MEMORY=750m`
!!! note
If experiencing issues such as "sleep: cannot read realtime clock: Operation not permitted", ensure `libseccomp` is up to date on your host. In some cases adding `:Z` flag to the `/data` mount may be needed, [but use cautiously](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label).

View File

@@ -1,31 +0,0 @@
### [itzg/minecraft-bedrock-server](https://github.com/itzg/docker-minecraft-bedrock-server)
Docker image that runs a Minecraft Bedrock server.
### [mc-router](https://github.com/itzg/mc-router)
Lightweight multiplexer/proxy for Minecraft Java servers. Provided as a stand-alone application and a Docker image.
### [itzg/bungeecord](https://github.com/itzg/docker-bungeecord/)
Docker image that runs a proxy powered by Bungeecord, Velocity, or Waterfall
### [itzg/mc-backup](https://github.com/itzg/docker-mc-backup)
Docker image that runs as a side-car container to backup world data.
### [rcon-cli](https://github.com/itzg/rcon-cli)
A tool that is bundled with this image to provide CLI access to an RCON endpoint.
### [mc-monitor](https://github.com/itzg/mc-monitor)
A tool that is bundled with this image that provides health checks and metrics reporting, such as a Prometheus exporter or a telegraf data source.
### [mc-image-helper](https://github.com/itzg/mc-image-helper)
A tool that is bundled with this image to provide complex, re-usable preparation operations.
### [itzg/rcon](https://github.com/itzg/docker-rcon-web-admin)
An image that dockerizes [rcon-web-admin](https://github.com/rcon-web-admin/rcon-web-admin).

View File

@@ -1,5 +0,0 @@
To troubleshoot the container initialization, such as when server files are pre-downloaded, set the environment variable `DEBUG` to `true`. The container logs will include **much more** output, and it is highly recommended including that output when reporting any [issues](https://github.com/itzg/docker-minecraft-server/issues).
To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`.
To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`.

View File

@@ -1,126 +0,0 @@
## Downloadable world
Instead of mounting the `/data` volume, you can instead specify the URL of a ZIP or compressed TAR 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, zip file, or compressed tar file that will be used as a source to clone or extract the world directory.
For example, the following would initially clone the world's content from `/worlds/basic`. Also notice in the example that you should use a read-only volume attachment to ensure the clone source remains pristine.
```
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
```
The following diagram shows how this option can be used in a compose deployment with a relative directory:
![](../img/world-copy-compose-project.drawio.png)
## 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.
## Custom worlds directory path
To set a custom worlds directory for the Multiverse plugin on a baremetal server, you'd pass the `--world-dir` argument after the jar file.
In order to accomplish the same in a containerized server, set the `EXTRA_ARGS` environment variable in your command line or docker compose yaml to the same argument string. For example:
```
docker run -d -e EXTRA_ARGS='--world-dir ./worlds/'
```
`--world-container`, `-W`, and `--universe` are aliases to `--world-dir` and can also be used.
## Datapacks
Datapacks can be installed in a similar manner to mods/plugins. There are many environment variables which function in the same way they do for [mods](../mods-and-plugins/index.md):
* `DATAPACKS`: comma-separated list of zip file URL, zip file in container, or directory in container
* `DATAPACKS_FILE`: a text file within the container where each line is a zip file URL, zip file in container, or directory in container
* `REMOVE_OLD_DATAPACKS`: if "true" the datapacks directory is removed of everything matching `REMOVE_OLD_DATAPACKS_INCLUDE`, but excluding `REMOVE_OLD_DATAPACKS_EXCLUDE` no deeper than `REMOVE_OLD_DATAPACKS_DEPTH`
* `REMOVE_OLD_DATAPACKS_DEPTH`: default is 16
* `REMOVE_OLD_DATAPACKS_INCLUDE`: default is `*.zip`
* `REMOVE_OLD_DATAPACKS_EXCLUDE`: default is empty
Datapacks will be placed in `/data/$LEVEL/datapacks`
## VanillaTweaks
[VanillaTweaks](https://vanillatweaks.net/) datapacks, crafting tweaks, and resource packs can be installed with a share code from the website **OR** a json file to specify packs to download and install. Datapacks and crafting tweaks will be installed into the current world directory specified by `$LEVEL`. As new versions of the packs are retrieved the previous versions will automatically be cleaned up.
The share code is the part following the hash sign, as shown here:
```
https://vanillatweaks.net/share/#MGr52E
------
|
+- share code MGr52E
```
Accepted Parameters:
- `VANILLATWEAKS_FILE`: comma separated list of JSON VanillaTweak pack files accessible within the container
- `VANILLATWEAKS_SHARECODE`: comma separated list of share codes
Example of expected VanillaTweaks share codes:
!!! note
ResourcePacks, DataPacks, and CraftingTweaks all have separate sharecodes
``` yaml
VANILLATWEAKS_SHARECODE: MGr52E,tF1zL2,LnEDwT
```
Example of expected VanillaTweaks files:
``` yaml
VANILLATWEAKS_FILE: /config/vt-datapacks.json,/config/vt-craftingtweaks.json,/config/vt-resourcepacks.json
```
``` json title="DataPacks json"
{
"type": "datapacks",
"version": "1.18",
"packs": {
"survival": [
"graves",
"multiplayer sleep"
],
"items": ["armored elytra"]
}
}
```
``` json title="ResourcePacks json"
{
"type": "resourcepacks",
"version": "1.18",
"packs": {
"aesthetic": ["CherryPicking", "BlackNetherBricks", "AlternateBlockDestruction"]
}
}
```
``` json title="CraftingTweaks Json"
{
"type": "craftingtweaks",
"version": "1.18",
"packs": {
"quality of life": [
"dropper to dispenser",
"double slabs",
"back to blocks"
]
}
}
```

View File

@@ -1,65 +0,0 @@
# Forge API
## ForgeAPI usage to use non-version specific projects
!!! warning "Deprecated"
This approach will soon be deprecated in favor of a variation of `AUTO_CURSEFORGE`.
!!! warning
This potentially could lead to unexpected behavior if the Mod receives an update with unexpected behavior.
This is more complicated because you will be pulling/using the latest mod for the release of your game. To get started make sure you have a [CursedForge API Key](https://docs.curseforge.com/#getting-started). Then use the environmental parameters in your docker build.
Please be aware of the following when using these options for your mods:
* Mod Release types: Release, Beta, and Alpha.
* Mod dependencies: Required and Optional
* Mod family: Fabric, Forge, and Bukkit.
Parameters to use the ForgeAPI:
* `MODS_FORGEAPI_KEY` - Required
* `MODS_FORGEAPI_FILE` - Required or use MODS_FORGEAPI_PROJECTIDS (Overrides MODS_FORGEAPI_PROJECTIDS)
* `MODS_FORGEAPI_PROJECTIDS` - Required or use MODS_FORGEAPI_FILE
* `MODS_FORGEAPI_RELEASES` - Default is release, Options: [Release|Beta|Alpha]
* `MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES` - Default is False, attempts to download required mods (releaseType Release) defined in Forge.
* `MODS_FORGEAPI_IGNORE_GAMETYPE` - Default is False, Allows for filtering mods on family type: FORGE, FABRIC, and BUKKIT. (Does not filter for Vanilla or custom)
* `REMOVE_OLD_FORGEAPI_MODS` - Default is False
* `REMOVE_OLD_DATAPACKS_DEPTH` - Default is 1
* `REMOVE_OLD_DATAPACKS_INCLUDE` - Default is *.jar
Example of expected forge api project ids, releases, and key:
```yaml
MODS_FORGEAPI_PROJECTIDS: 306612,256717
MODS_FORGEAPI_RELEASES: Release
MODS_FORGEAPI_KEY: $WRX...
```
Example of expected ForgeAPI file format.
**Field Description**:
* `name` is currently unused, but can be used to document each entry.
* `projectId` id is the id found on the CurseForge website for a particular mod
* `releaseType` Type corresponds to forge's R, B, A icon for each file. Default Release, options are (release|beta|alpha).
* `fileName` is used for version pinning if latest file will not work for you.
```json
[
{
"name": "fabric api",
"projectId": "306612",
"releaseType": "release"
},
{
"name": "fabric voice mod",
"projectId": "416089",
"releaseType": "beta"
},
{
"name": "Biomes o plenty",
"projectId": "220318",
"fileName": "BiomesOPlenty-1.18.1-15.0.0.100-universal.jar",
"releaseType": "release"
}
]
```

View File

@@ -1,136 +0,0 @@
# Working with mods and plugins
## Mod platforms
By far the easiest way to work with mod and plugins, especially large numbers of them, is to utilize modpacks with [one of the supported mod platforms](../types-and-platforms/index.md).
The following are some supported mod platforms:
- [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md)
- [CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md)
- [Feed the Beast](../types-and-platforms/mod-platforms/ftb.md)
## Download automation
On the left, there are sections describing some download automation options.
## Mods vs Plugins
The terms "mods" and "plugins" can be quite confusing. Generally, the rule of thumb is that "mods" are used by the types that run client side to modify rendering, add new blocks, and add behaviors server, such as [Forge](../types-and-platforms/server-types/forge.md) and [Fabric](../types-and-platforms/server-types/fabric.md). "Plugins" are used by the types that **only run on servers** to add behaviors, commands, etc such as [Paper](../types-and-platforms/server-types/paper.md) (which derives from [Bukkit/Spigot](../types-and-platforms/server-types/bukkit-spigot.md)). There are also some types that are [hybrids](../types-and-platforms/server-types/hybrids.md), such as Magma, that use both "mods" and "plugins"
## Optional plugins, mods, and config attach points
There are optional volume paths that can be attached to supply content to be copied into the data area:
`/plugins`
: content in this directory is synchronized into `/data/plugins` for server types that use plugins, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_PLUGINS_SRC` and destination by setting `COPY_PLUGINS_DEST`.
`/mods`
: content in this directory is synchronized into `/data/mods` for server types that use mods, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_MODS_SRC` and destination by setting `COPY_MODS_DEST`.
`/config`
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. 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. The source can be changed by setting `COPY_CONFIG_SRC`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
By default, the [environment variable processing](../configuration/interpolating.md) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.
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, which are comma separated lists of file glob patterns. If a directory is excluded, then it and all of its contents are excluded. By default, only jars are 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.
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.
!!! information ""
For more flexibility with mods/plugins preparation, you can declare other directories, files, and URLs to use in [the `MODS` / `PLUGINS` variables](#modsplugins-list).
## Zip file modpack
Like the `WORLD` option above, you can specify the URL or path of a "mod pack"
to download and install into `mods` for Forge/Fabric or `plugins` for Bukkit/Spigot.
To use this option pass the environment variable `MODPACK`, such as
```shell
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.
## Generic pack files
To install all the server content (jars, mods, plugins, configs, etc.) from a zip or tgz file, then set `GENERIC_PACK` to the container path or URL of the archive file. This can also be used to apply a CurseForge modpack that is missing a server start script and/or Forge installer.
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of archive file paths and/or URLs to files.
To avoid repetition, each entry will be prefixed by the value of `GENERIC_PACKS_PREFIX` and suffixed by the value of `GENERIC_PACKS_SUFFIX`, both of which are optional. For example, the following variables
```
GENERIC_PACKS=configs-v9.0.1,mods-v4.3.6
GENERIC_PACKS_PREFIX=https://cdn.example.org/
GENERIC_PACKS_SUFFIX=.zip
```
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update can be time-consuming. To skip the update set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
The most time-consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true.
## Mods/plugins list
You may also download or copy over individual mods/plugins using the `MODS` or `PLUGINS` environment variables. Both are a comma or newline delimited list of
- URL of a jar file
- container path to a jar file
- container path to a directory containing jar files
```shell
docker run -d -e MODS=https://www.example.com/mods/mod1.jar,/plugins/common,/plugins/special/mod2.jar ...
```
The newline delimiting allows for compose file usage like:
```yaml
PLUGINS: |
https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
```
## Mod/Plugin URL Listing File
As an alternative to `MODS`/`PLUGINS`, the variable `MODS_FILE` or `PLUGINS_FILE` can be set with the container path or URL of a text file listing a mod/plugin URLs on each line. For example, the following
-e MODS_FILE=/extras/mods.txt
would load from a file mounted into the container at `/extras/mods.txt`. That file might look like:
```text
https://edge.forgecdn.net/files/2965/233/Bookshelf-1.15.2-5.6.40.jar
https://edge.forgecdn.net/files/2926/27/ProgressiveBosses-2.1.5-mc1.15.2.jar
# This and next line are ignored
#https://edge.forgecdn.net/files/3248/905/goblintraders-1.3.1-1.15.2.jar
https://edge.forgecdn.net/files/3272/32/jei-1.15.2-6.0.3.16.jar
https://edge.forgecdn.net/files/2871/647/ToastControl-1.15.2-3.0.1.jar
```
!!! note
Blank lines and lines that start with a `#` will be ignored
[This compose file](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-mods-file.yml) shows another example of using this feature.
## Remove old mods/plugins
When the `MODPACK` option above is specified 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
```shell
docker run -d -e REMOVE_OLD_MODS=TRUE -e MODPACK=http://www.example.com/mods/modpack.zip ...
```
!!! danger
All content of the `mods` or `plugins` directory will be deleted before unpacking new content from the MODPACK or MODS.

View File

@@ -1,18 +0,0 @@
# Auto-download from Modrinth
[Modrinth](https://modrinth.com/) is an open source modding platform with a clean, easy to use website for finding [Fabric and Forge mods](https://modrinth.com/mods). At startup, the container will automatically locate and download the newest versions of mod/plugin files that correspond to the `TYPE` and `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up.
- **MODRINTH_PROJECTS** : comma separated list of project slugs (short name) or IDs. The project ID can be located in the "Technical information" section. The slug is the part of the page URL that follows `/mod/`:
```
https://modrinth.com/mod/fabric-api
----------
|
+-- project slug
```
Also, specific version/type can be declared using colon symbol and version id/type after the project slug. The version id can be found at 'Metadata' section. Valid version types are `release`, `beta`, `alpha`. For instance:
```
-e MODRINTH_PROJECTS=fabric-api,fabric-api:PbVeub96,fabric-api:beta
```
- **MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES**=true : required dependencies of the project will _always_ be downloaded and optional dependencies can also be downloaded by setting this to `true`
- **MODRINTH_ALLOWED_VERSION_TYPE**=release : the version type is used to determine the newest version to use from each project. The allowed values are `release`, `beta`, `alpha`.

View File

@@ -1,17 +0,0 @@
# Packwiz Modpacks
[packwiz](https://packwiz.infra.link/) is a CLI tool for maintaining and providing modpack definitions, with support for both CurseForge and Modrinth as sources. See the [packwiz tutorial](https://packwiz.infra.link/tutorials/getting-started/) for more information.
To configure server mods using a packwiz modpack, set the `PACKWIZ_URL` environment variable to the location of your `pack.toml` modpack definition:
```
docker run -d -v /path/on/host:/data -e TYPE=FABRIC \
-e "PACKWIZ_URL=https://example.com/modpack/pack.toml" \
itzg/minecraft-server
```
packwiz modpack definitions are processed before other mod definitions (`MODPACK`, `MODS`, etc.) to allow for additional processing/overrides you may want to perform (in case of mods not available via Modrinth/CurseForge, or you do not maintain the pack).
!!! note
packwiz is pre-configured to only download server mods. If client-side mods are downloaded and cause issues, check your pack.toml configuration, and make sure any client-only mods are not set to `"both"`, but rather `"client"` for the side configuration item.

View File

@@ -1,19 +0,0 @@
# Auto-download using Spiget
The `SPIGET_RESOURCES` variable can be set with a comma-separated list of SpigotMC resource IDs to automatically download [Spigot/Bukkit/Paper 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.
!!! important "SPIGET not SPIGOT"
The variable is purposely spelled SPIG**E**T with an "E"
The **resource ID** can be located from the numerical part of the URL after the shortname/slug and a dot. For example, the ID is **28140** from
https://www.spigotmc.org/resources/luckperms.28140/
=====
For example, the following will auto-download the [LuckPerms](https://www.spigotmc.org/resources/luckperms.28140/) and [Vault](https://www.spigotmc.org/resources/vault.34315/) plugins:
-e SPIGET_RESOURCES=28140,34315
!!! note
Some plugins, such as EssentialsX (resource ID 9089), do not permit automated downloads via Spiget. Instead, you will need to pre-download the desired file and supply it to the container, such as using the `/plugins` mount point, described [in the main section](index.md).

View File

@@ -1,9 +0,0 @@
mkdocs
mkdocs-material-extensions
mkdocs-material
mkdocs-autorefs
mkdocstrings
mkdocs-literate-nav
mdx-gh-links
mkdocs-click
mkdocs-static-i18n

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,14 +0,0 @@
# Server Types and Mod Platforms
Server types can be selected by setting the `TYPE` environment variable to one of the types described in these sections.
The default server type is [the official software provided by Mojang](https://www.minecraft.net/en-us/download/server), which can be explicitly selected by setting `TYPE` to "VANILLA".
**From the sections to the left...**
The **mod platforms** take a modpack identifier, file, etc and use that to select and download the appropriate version of a mod loader, such as Forge or Fabric, downloading declared mods/plugins, and apply any additional files. The mod platforms are selected by setting `MOD_PLATFORM`; however, for ease of use and compatibility, the selection can be set in `TYPE`.
The individual **server types** allow for selecting the mod loader / server type and specific versions of those.
!!! important
For all the server types, the `VERSION` environment variable is used to declare the Minecraft version itself, such as 1.19.4. Each server type will have specific variables for qualifying their version in addition to the Minecraft version.

View File

@@ -1,114 +0,0 @@
# Auto CurseForge
To manage a CurseForge modpack automatically with upgrade support, pinned or latest version tracking, set `MOD_PLATFORM` or `TYPE` to "AUTO_CURSEFORGE". The appropriate mod loader (Forge / Fabric) version will be automatically installed as declared by the modpack. This mode will also take care of cleaning up unused files installed by previous versions of the modpack, but world data is never auto-removed.
## API Key
!!! warning "CurseForge API key usage"
A CurseForge API key is **required** to use this feature. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable `CF_API_KEY`.
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`.
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
```yaml
environment:
CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
```
If you use `docker run` you will need to make sure to use single quotes:
```shell
docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
```
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). `$`'s in the value still need to escaped with a second `$` and the variable needs to be referenced from the compose file, such as:
```yaml
environment:
CF_API_KEY: ${CF_API_KEY}
```
To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
```
docker run --env-file=.env itzg/minecraft-server
```
!!! note
Be sure to use the appropriate [image tag for the Java version compatible with the modpack](../../versions/java.md).
Most modpacks require a good amount of memory, so it best to set `MEMORY` to at least "4G" since the default is only 1 GB.
## Usage
Use one of the following to specify the modpack to install:
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". For example:
```
-e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
```
Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as
![cf-slug](../../img/cf-slug.png)
For example:
```
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
```
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
!!! note "Mods need download report"
A file called `MODS_NEED_DOWNLOAD.txt` will be created in the `/data` directory that lists the mods that need to be manually downloaded and where to get them.
If you wish to use a unpublished modpack zip, set the container path to the file in `CF_MODPACK_ZIP`. Similarly, the container path to a modpack manifest JSON can be passed to `CF_MODPACK_MANIFEST`. In either case, **the modpack slug or page URL must still be provided**.
The latest file will be located and used by default, but if a specific version is desired you can use one of the following options. With any of these options **do not select a server file** -- they lack the required manifest and defeat the ability to consistently automate startup.
- Use `CF_PAGE_URL`, but include the full URL to a specific file
- Set `CF_FILE_ID` to the numerical file ID
- Specify a substring to match the desired filename with `CF_FILENAME_MATCHER`
The following shows where to get the URL to the specific file and also shows where the file ID is located:
![cf-file-id](../../img/cf-file-id.png)
The following examples all refer to version 1.0.7 of ATM8:
```
-e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390
```
```
-e CF_SLUG=all-the-mods-8 -e CF_FILE_ID=4248390
```
```
-e CF_SLUG=all-the-mods-8 -e CF_FILENAME_MATCHER=1.0.7
```
## Exclude client mods
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods:
Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
A mod's project ID can be obtained from the right hand side of the project page:
![cf-project-id](../../img/cf-project-id.png)
For more complex scenarios, global and per modpack exclusions can be declared in a container-accessible JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json) will be used, but can be disabled by setting this to an empty string. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
If needing to iterate on the options above, set `CF_FORCE_SYNCHRONIZE` to "true" to ensure the exclude/includes are re-evaluated.
!!! important
These options are provided to empower you to get your server up and running quickly. Please help out by reporting an issue with the respective mod project. Ideally mod developers should [use correct registrations for one-sided client mods](https://docs.minecraftforge.net/en/latest/concepts/sides/#writing-one-sided-mods). Understandably, those code changes may be non-trivial, so mod authors can also add "Client" to the game versions when publishing.
## Extra options
Some modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the `LEVEL` to the resulting saves directory by setting `CF_SET_LEVEL_FROM` to either:
- `WORLD_FILE`
- `OVERRIDES`
Other configuration available:
- `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform
- `CF_OVERRIDES_SKIP_EXISTING` (default is false): if set, files in the overrides that already exist in the data directory are skipped. **NOTE** world data is always skipped, if present.

View File

@@ -1,42 +0,0 @@
# Manual CurseForge server packs
Enable this server mode by setting `MOD_PLATFORM` or `TYPE` to "CURSEFORGE" along with the following specific variables.
You need to specify a modpack to run, using the `CF_SERVER_MOD` environment
variable. A CurseForge server modpack is available together with its respective
client modpack at <https://www.curseforge.com/minecraft/modpacks> .
Now you can add a `-e CF_SERVER_MOD=name_of_modpack.zip` to your command-line.
docker run -d -v /path/on/host:/data -e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
If you want to keep the pre-download modpacks separate from your data directory,
then you can attach another volume at a path of your choosing and reference that.
The following example uses `/modpacks` as the container path as the pre-download area:
docker run -d -v /path/on/host:/data -v /path/to/modpacks:/modpacks \
-e TYPE=CURSEFORGE \
-e CF_SERVER_MOD=/modpacks/SkyFactory_4_Server_4.1.0.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
### Modpack data directory
By default, CurseForge modpacks are expanded into the sub-directory `/data/FeedTheBeast` and executed from there. (The default location was chosen for legacy reasons, when Curse and FTB were maintained together.)
The directory can be changed by setting `CF_BASE_DIR`, such as `-e CF_BASE_DIR=/data`.
### Buggy start scripts
Some modpacks have buggy or overly complex start scripts. You can avoid using the bundled start script and use this image's standard server-starting logic by adding `-e USE_MODPACK_START_SCRIPT=false`.
### Fixing "unable to launch forgemodloader"
If your server's modpack fails to load with an error [like this](https://support.feed-the-beast.com/t/cant-start-crashlanding-server-unable-to-launch-forgemodloader/6028/2):
unable to launch forgemodloader
then you apply a workaround by adding this to the run invocation:
-e FTB_LEGACYJAVAFIXER=true

View File

@@ -1,41 +0,0 @@
# Feed the Beast
!!! note
Requires one of the Ubuntu with Hotspot images listed in [the Java versions section](../../versions/java.md).
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by setting `MOD_PLATFORM` or `TYPE` to "FTBA"
!!! note
The "A" at the end of "FTBA" is important. The value "FTB" used to be an alias for "CURSEFORGE".
This mod platform type will automatically take care of downloading and installing the modpack and appropriate version of Forge, so the `VERSION` does not need to be specified.
### Environment Variables:
- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by [finding the modpack](https://www.feed-the-beast.com/modpack) and locating the ID in this part of the URL:
```
https://www.feed-the-beast.com/modpacks/23-ftb-infinity-evolved-17
^^
```
- `FTB_MODPACK_VERSION_ID`: optional, the numerical ID of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by hovering over a server file entry and grabbing [this ID in the URL](../../img/ftba-version-id-popup.png).
- `FTB_FORCE_REINSTALL`: if the files become inconsistent, such as when accidentally removing them, the FTB can be forced to re-run by setting this to "true"
### Upgrading
If a specific `FTB_MODPACK_VERSION_ID` was not specified, simply restart the container to pick up the newest modpack version. If using a specific version ID, recreate the container with the new version ID.
### Example
The following example runs the latest version of [FTB Presents Direwolf20 1.12](https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/):
``` shell
docker run -d --name mc-ftb -e EULA=TRUE \
-e TYPE=FTBA -e FTB_MODPACK_ID=31 \
-p 25565:25565 \
itzg/minecraft-server:java8-multiarch
```
!!! note
Normally you will also add `-v` volume for `/data` since the mods and config are installed there along with world data.

View File

@@ -1,25 +0,0 @@
# Modrinth Modpacks
[Modrinth Modpacks](https://modrinth.com/modpacks) can automatically be installed along with the required mod loader (Forge or Fabric) by setting `MOD_PLATFORM` or `TYPE` to "MODRINTH". Upgrading (and downgrading) takes care of cleaning up old files and upgrading (and downgrading) the mod loader.
The desired modpack project is specified with the `MODRINTH_PROJECT` environment variable and must be one of:
- The project "slug", which is located in the URL shown here:
![](../../img/modrinth-project-slug.drawio.png)
- The project ID, which is located in the bottom of the left panel, shown here
![](../../img/modrinth-project-id.drawio.png)
- The project page URL, such as <https://modrinth.com/modpack/cobblemon-fabric>. As described below, this can further be the page URL of a modpack's version page.
The automatic modpack version resolving can be narrowed in a few ways:
The latest release or beta version, respectively, of the Modrinth modpack is selected when `VERSION` is "LATEST" or "SNAPSHOT". That can be overridden by setting `MODRINTH_DEFAULT_VERSION_TYPE` to "release", "beta", or "alpha".
Furthermore, the resolved modpack version can be narrowed by setting `VERSION` to a specific Minecraft version, such as "1.19.2".
The selected version can also be narrowed to a particular mod loader by setting `MODRINTH_LOADER` to either "forge", "fabric", or "quilt".
Instead of auto resolving, a specific version of modpack file can be specified by passing the version's page URL to `MODRINTH_PROJECT`, such as <https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2> or by setting `MODRINTH_VERSION` to the version ID or number located in the Metadata section, as shown here
![](../../img/modrinth-version-id.drawio.png)

View File

@@ -1,42 +0,0 @@
# Bukkit/Spigot
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT` or `-e TYPE=SPIGOT` to your command-line.
```
docker run -d -v /path/on/host:/data \
-e TYPE=SPIGOT \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
If the downloaded server jar is corrupted, set `FORCE_REDOWNLOAD` to "true" to force a re-download during next container startup. After successfully re-downloading, you should remove that or set to "false".
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
- -e BUKKIT_DOWNLOAD_URL=<url>
- -e SPIGOT_DOWNLOAD_URL=<url>
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
Plugins can either be managed within the `plugins` subdirectory of the [data directory](../../data-directory.md) or you can also [attach a `/plugins` volume](../../mods-and-plugins/index.md#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
!!! 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.
## Alternatives
### Canyon
[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
!!! important
Only `VERSION=b1.7.3` is supported. Since that version pre-dates the health check mechanism used by this image, that will need to be disabled by setting `DISABLE_HEALTHCHECK=true`.
Canyon is on a temporary hiatus, so by default the final build from GitHub will be used; however, a specific build number can be selected in some instances by setting `CANYON_BUILD`, such as
-e CANYON_BUILD=6
-e CANYON_BUILD=26

View File

@@ -1,27 +0,0 @@
Enable [Fabric server](https://fabricmc.net/) mode by adding a `-e TYPE=FABRIC` to your command-line.
```
docker run -d -v /path/on/host:/data \
-e TYPE=FABRIC \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
By default, the container will install the latest [fabric server launcher](https://fabricmc.net/use/server/), using the latest [fabric-loader](https://fabricmc.net/wiki/documentation:fabric_loader) against the minecraft version you have defined with `VERSION` (defaulting to the latest vanilla release of the game).
A specific loader or launcher version other than the latest can be requested using `FABRIC_LOADER_VERSION` and `FABRIC_LAUNCHER_VERSION` respectively, such as:
```
docker run -d -v /path/on/host:/data ... \
-e TYPE=FABRIC \
-e FABRIC_LAUNCHER_VERSION=0.10.2 \
-e FABRIC_LOADER_VERSION=0.13.1
```
!!! note
If you wish to use an alternative launcher you can:
- Provide the path to a custom launcher jar available to the container with `FABRIC_LAUNCHER`, relative to `/data` (such as `-e FABRIC_LAUNCHER=fabric-server-custom.jar`)
- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`)
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.

View File

@@ -1,32 +0,0 @@
Enable [Forge server](http://www.minecraftforge.net/) 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/minecraft.md) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGE_VERSION`, such as `-e FORGE_VERSION=14.23.5.2854`.
```
docker run -d -v /path/on/host:/data \
-e TYPE=FORGE \
-e VERSION=1.12.2 -e FORGE_VERSION=14.23.5.2854 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
specify the name of the installer file with `FORGE_INSTALLER`, such as:
```
docker run -d -v /path/on/host:/data ... \
-e FORGE_INSTALLER=forge-1.11.2-13.20.0.2228-installer.jar ...
```
To download a Forge installer from a custom location, such as your own file repository, specify
the URL with `FORGE_INSTALLER_URL`, such as:
```
docker run -d -v /path/on/host:/data ... \
-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.
!!! note
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.

View File

@@ -1,34 +0,0 @@
### Magma
A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with
-e TYPE=MAGMA
!!! note
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2", "1.16.5", etc.
### Mohist
A [Mohist](https://github.com/MohistMC/Mohist) server can be used with
-e TYPE=MOHIST
!!! note
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
By default the latest build will be used; however, a specific build number can be selected by setting `MOHIST_BUILD`, such as
-e VERSION=1.16.5 -e MOHIST_BUILD=374
### Catserver
A [Catserver](http://catserver.moe/) type server can be used with
-e TYPE=CATSERVER
> **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored

View File

@@ -1,68 +0,0 @@
## SpongeVanilla
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.
Beware that current [Sponge](https://www.spongepowered.org) `STABLE` versions for Minecraft 1.12 require using [the Java 8 tag](../../versions/java.md):
``` shell
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server:java8-multiarch
```
You can also choose to use the `EXPERIMENTAL` branch.
Just change it with `SPONGEBRANCH`, such as:
``` shell
$ docker run -d -v /path/on/host:/data ... \
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
```
## Limbo
A [Limbo](https://github.com/LOOHP/Limbo) server can be run by setting `TYPE` to `LIMBO`.
Configuration options with defaults:
- `LIMBO_BUILD`=LATEST
The `VERSION` will be ignored so locate the appropriate value from [here](https://ci.loohpjames.com/job/Limbo/) to match the version expected by clients.
- `FORCE_REDOWNLOAD`=false
- `LIMBO_SCHEMA_FILENAME`=default.schem
- `LEVEL`="Default;${LIMBO_SCHEMA_NAME}"
!!! note
Instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
## Crucible
A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`.
Configuration options with defaults:
- `CRUCIBLE_RELEASE`=latest
Crucible is only available for 1.7.10, so be sure to set `VERSION=1.7.10`.
## Custom
To use a custom server jar or class files, set `TYPE` to "CUSTOM" and continue with one of the following options:
The custom jar to be used can be set with `CUSTOM_SERVER` as either a URL to download or the path to a file within the container.
Alternatively, the final `-jar` invocation can be replaced by setting `CUSTOM_JAR_EXEC` to "`-cp <classpath> <classname>`" or "`-jar <jar file>`" form, such as
```
-cp worldedit.jar:Carpet-Server.jar net.minecraft.server.MinecraftServer
```
!!! note
When using `docker run` make sure to quote the entire value since it has spaces in it, such as
-e CUSTOM_JAR_EXEC="-cp worldedit.jar:Carpet-Server.jar net.minecraft.server.MinecraftServer"

View File

@@ -1,65 +0,0 @@
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
By default, the container will run the latest build of [Paper server](https://papermc.io/downloads) but you can also choose to run a specific build with `-e PAPERBUILD=205`.
docker run -d -v /path/on/host:/data \
-e TYPE=PAPER \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`.
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](../../mods-and-plugins/index.md#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
## Alternatives
### Pufferfish
A [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) server, which is "a highly optimized Paper fork designed for large servers requiring both maximum performance, stability, and "enterprise" features."
-e TYPE=PUFFERFISH
!!! note
The `VERSION` variable is used to select branch latest, 1.18, or 1.17. Use PUFFERFISH_BUILD to really select the SERVER VERSION number.
Extra variables:
- `PUFFERFISH_BUILD=lastSuccessfulBuild` : set a specific Pufferfish build to use. Example: selecting build 47 => 1.18.1, or build 50 => 1.18.2 etc
- `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 built-in [Flare](https://blog.airplane.gg/flare) profiler
### Purpur
A [Purpur](https://purpurmc.org/) server, which is "a drop-in replacement for Paper servers designed for configurability and new, fun, exciting gameplay features."
-e TYPE=PURPUR
!!! note
The `VERSION` variable is used to lookup a build of Purpur to download
Extra variables:
- `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
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the built-in [Flare](https://blog.airplane.gg/flare) profiler
- `PURPUR_DOWNLOAD_URL=<url>` : set URL to download Purpur from custom URL.
### Folia
Enable Folia server mode by adding a `-e TYPE=FOLIA` to your command-line.
By default, the container will run the latest build of [Folia server](https://papermc.io/downloads), but you can also choose to run a specific build with `-e FOLIABUILD=26`.
docker run -d -v /path/on/host:/data \
-e TYPE=FOLIA \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
If you are hosting your own copy of Folia you can override the download URL with `FOLIA_DOWNLOAD_URL=<url>`.
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](../../mods-and-plugins/index.md#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
!!! note
The Folia type inherits from the Paper type. Paper's variables will override the Folia ones.

View File

@@ -1,27 +0,0 @@
Enable [Quilt server](https://quiltmc.org/) mode by adding a `-e TYPE=QUILT` to your command-line.
```
docker run -d -v /path/on/host:/data \
-e TYPE=QUILT \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
By default, the container will install the latest [quilt server launcher](https://quiltmc.org/install/server/), using the latest [quilt-installer](https://github.com/QuiltMC/quilt-installer) against the minecraft version you have defined with `VERSION` (defaulting to the latest vanilla release of the game).
A specific loader or installer version other than the latest can be requested using `QUILT_LOADER_VERSION` and `QUILT_INSTALLER_VERSION` respectively, such as:
```
docker run -d -v /path/on/host:/data ... \
-e TYPE=QUILT \
-e QUILT_LOADER_VERSION=0.16.0 \
-e QUILT_INSTALLER_VERSION=0.4.1
```
!!! note
If you wish to use an alternative launcher you can:
- Provide the path to a custom launcher jar available to the container with `QUILT_LAUNCHER`, relative to `/data` (such as `-e QUILT_LAUNCHER=quilt-server-custom.jar`)
- Provide the URL to a custom launcher jar with `QUILT_LAUNCHER_URL` (such as `-e QUILT_LAUNCHER_URL=http://HOST/quilt-server-custom.jar`)
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Quilt mods and configuration.

View File

@@ -1,806 +0,0 @@
### **OS OPTIONS**
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>UID</code></td>
<td>The linux user id to run as</td>
<td><code>1000</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>GID</code></td>
<td>The linux group id to run as</td>
<td><code>1000</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MEMORY</code></td>
<td>The image declares an initial and maximum Java memory-heap limit of 1 GB.</td>
<td><code>1G</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>INIT_MEMORY</code></td>
<td>Independently sets the initial heap size</td>
<td><code>1G</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MAX_MEMORY</code></td>
<td>independently sets the max heap size</td>
<td><code>1G</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>TZ</code></td>
<td>You can configure the timezone to match yours by setting the TZ environment variable.
alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
/etc/timezone:/etc/timezone:ro</code>
</td>
<td><code>1G</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENABLE_ROLLING_LOGS</code></td>
<td>By default the vanilla log file will grow without limit. The logger can be reconfigured to use a rolling log files strategy by setting this to <code>true</code></td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENABLE_JMX</code></td>
<td>To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable ENABLE_JMX=true</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>JMX_HOST</code></td>
<td>If JMX is enabled, set JMX_HOST to the IP/host running the Docker container, and add a port forwarding of TCP port 7091</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>USE_AIKAR_FLAGS</code></td>
<td><a href="https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/">Aikar has done some research</a> into finding the optimal JVM flags for GC tuning, which becomes more important as more users are connected concurrently</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>JVM_OPTS</code></td>
<td>General JVM options can be passed to the Minecraft Server invocation by passing a <code>JVM_OPTS</code> environment variable. The JVM requires -XX options to precede -X options, so those can be declared in <code>JVM_XX_OPTS</code>. Both variables are space-delimited, raw JVM arguments</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>JVM_XX_OPTS</code></td>
<td>General JVM options can be passed to the Minecraft Server invocation by passing a <code>JVM_OPTS</code> environment variable. The JVM requires -XX options to precede -X options, so those can be declared in <code>JVM_XX_OPTS</code>. Both variables are space-delimited, raw JVM arguments</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>JVM_DD_OPTS</code></td>
<td>As a shorthand for passing several system properties as -D arguments, you can instead pass a comma separated list of name=value or name:value pairs with JVM_DD_OPTS. (The colon syntax is provided for management platforms like Plesk that don't allow = inside a value.)</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>EXTRA_ARGS</code></td>
<td>Arguments that would usually be passed to the jar file (those which are written after the filename)</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>LOG_TIMESTAMP </code></td>
<td>To include the timestamp with each log set to <code>true</code></td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **SERVER**
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>TYPE</code></td>
<td>The server <a href="../types-and-platforms/">type</a></td>
<td><code>VANILLA</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>EULA</code></td>
<td>You <strong>MUST</strong> set this to <code>true</code></td>
<td><code>&nbsp;</code></td>
<td>✅</td>
</tr>
<tr>
<td><code>VERSION</code></td>
<td>The minecraft version</td>
<td><code>LATEST</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MOTD</code></td>
<td>Set the server log in message.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>DIFFICULTY</code></td>
<td>The difficulty level. Available values: <code>peaceful</code>,<code>easy</code>,<code>normal</code>,<code>hard</code></td>
<td><code>easy</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ICON</code></td>
<td>The url or file path for the icon image to use for the server. It will be downloaded, scaled, and converted to the proper format.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>OVERRIDE_ICON</code></td>
<td>The server icon which has been set doesn't get overridden by default. Set this to <code>TRUE</code> to override the icon</td>
<td><code>FALSE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MAX_PLAYERS</code></td>
<td>The maximum number of players that can join the server.</td>
<td><code>20</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MAX_WORLD_SIZE</code></td>
<td>The maximum possible size in blocks, expressed as a radius.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ALLOW_NETHER</code></td>
<td>Allows players to travel to the Nether</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ANNOUNCE_PLAYER_ACHIEVEMENTS</code></td>
<td>Allows server to announce when a player gets an achievement.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENABLE_COMMAND_BLOCK</code></td>
<td>Enables the command blocks.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>FORCE_GAMEMODE</code></td>
<td>Force players to join in the default game mode.</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>GENERATE_STRUCTURES</code></td>
<td>Defines whether structures (such as villages) will be generated.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>HARDCORE</code></td>
<td>If set to <code>true</code>, players will be set to spectator mode if they die.</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SNOOPER_ENABLED</code></td>
<td>If set to false, the server will not send data to snoop.minecraft.net server.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MAX_BUILD_HEIGHT</code></td>
<td>The maximum height in which building is allowed. Terrain may still naturally generate above a low height limit.</td>
<td><code>256</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SPAWN_ANIMALS</code></td>
<td>Determines if animals will be able to spawn.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SPAWN_MONSTERS</code></td>
<td>Determines if monsters will be spawned.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SPAWN_NPCS</code></td>
<td>Determines if villagers will be spawned.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SPAWN_PROTECTION</code></td>
<td>Sets the area that non-ops can not edit (0 to disable)</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>VIEW_DISTANCE</code></td>
<td>Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). It determines the server-side viewing distance.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SEED</code></td>
<td>Sets the seed to create the Minecraft world. If you use a negative number, make sure that it is in quotes.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>MODE</code></td>
<td>Minecraft servers are configured to run in Survival mode by default. You can change the mode using MODE where you can either provide the <a href="http://minecraft.gamepedia.com/Game_mode#Game_modes">standard numerical values</a> or the shortcut values:<br />
<ul>
<li>creative</li>
<li>survival</li>
<li>adventure</li>
<li>spectator(minecraft 1.8 or later)</li>
</ul></td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>PVP</code></td>
<td>By default, servers are created with player-vs-player (PVP) mode enabled.</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>LEVEL_TYPE</code></td>
<td>By default, a standard world is generated with hills, valleys, water, etc. A different level type can be configured by setting LEVEL_TYPE to <a href="https://minecraft.fandom.com/wiki/Server.properties#level-type">an expected type listed here</a>.
</td>
<td><code>minecraft:default</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>GENERATOR_SETTINGS</code></td>
<td>For some of the level types, <code>GENERATOR_SETTINGS</code> can be used to further customize the world generation <a href="https://minecraft.fandom.com/wiki/Server.properties#generator-settings">as described here</a>.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>LEVEL</code></td>
<td>You can either switch between world saves or run multiple containers with different saves by using the LEVEL option</td>
<td><code>world</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ONLINE_MODE</code></td>
<td>By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ALLOW_FLIGHT</code></td>
<td>Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.</td>
<td><code>FALSE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SERVER_NAME</code></td>
<td>The server name</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SERVER_PORT</code></td>
<td>Only change this value if you know what you're doing. It is only needed when using host networking and it is rare that host networking should be used.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>PLAYER_IDLE_TIMEOUT</code></td>
<td>player-idle-timeout</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENABLE_JMX</code></td>
<td>enable-jmx-monitoring</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SYNC_CHUNK_WRITES</code></td>
<td>sync-chunk-writes</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENABLE_STATUS</code></td>
<td>enable-status</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>ENTITY_BROADCAST_RANGE_PERCENTAGE</code></td>
<td>entity-broadcast-range-percentage</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>FUNCTION_PERMISSION_LEVEL</code></td>
<td>function-permission-level</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>NETWORK_COMPRESSION_THRESHOLD</code></td>
<td>network-compression-threshold</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>OP_PERMISSION_LEVEL</code></td>
<td>op-permission-level</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>PREVENT_PROXY_CONNECTIONS</code></td>
<td>prevent-proxy-connections</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>USE_NATIVE_TRANSPORT</code></td>
<td>use-native-transport</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SIMULATION_DISTANCE</code></td>
<td>simulation-distance</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>EXEC_DIRECTLY</code></td>
<td>If you would like to docker attach to the Minecraft server console with color and interactive capabilities, then set to <code>true</code></td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>STOP_SERVER_ANNOUNCE_DELAY</code></td>
<td>To allow time for players to finish what they're doing during a graceful server shutdown, set <code>STOP_SERVER_ANNOUNCE_DELAY</code> to a number of seconds to delay after an announcement is posted by the server.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>PROXY</code></td>
<td>You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CONSOLE</code></td>
<td>Some older versions (pre-1.14) of Spigot required <code>--noconsole</code> to be passed when detaching stdin</td>
<td><code>TRUE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>GUI</code></td>
<td>Some older servers get confused and think that the GUI interface is enabled.</td>
<td><code>TRUE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>STOP_DURATION</code></td>
<td>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.</td>
<td><code>60</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>SETUP_ONLY</code></td>
<td>If you are using a host-attached data directory, then you can have the image setup the Minecraft server files and stop prior to launching the server process by setting this to <code>true</code></td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>USE_FLARE_FLAGS</code></td>
<td>To enable the JVM flags required to fully support the <a href="https://blog.airplane.gg/flare">Flare profiling suite</a>.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>USE_SIMD_FLAGS</code></td>
<td>Support for optimized SIMD operation</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<!-- <tr>
<td><code></code></td>
<td></td>
<td><code></code></td>
<td>⬜️</td>
</tr> -->
</tbody>
</table>
### **CUSTOM RESOURCE PACK**
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>RESOURCE_PACK</code></td>
<td>A link to a custom resource pack</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RESOURCE_PACK_SHA1</code></td>
<td>The checksum for the custom resource pack</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RESOURCE_PACK_ENFORCE</code></td>
<td>Enforce the resource pack on clients</td>
<td><code>FALSE</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **WHITELIST**
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ENABLE_WHITELIST</code></td>
<td>Enable the whitelist to manually manage the whitelist</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>WHITELIST</code></td>
<td>A list of usernames and/or UUIDs separated by comma</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>WHITELIST_FILE</code></td>
<td>A url or file path to a whitelist <code>json</code> formatted file.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>OVERRIDE_WHITELIST</code></td>
<td>Enforce regeneration of the whitelist on each server startup.</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **RCON**
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ENABLE_RCON</code></td>
<td>Should RCON be enabled</td>
<td><code>true</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_PASSWORD</code></td>
<td>You <strong>MUST</strong> change this value</td>
<td><code>Randomly generated</code></td>
<td>✅</td>
</tr>
<tr>
<td><code>RCON_PORT</code></td>
<td>The port for RCON</td>
<td><code>25575</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>BROADCAST_RCON_TO_OPS</code></td>
<td>Should RCON be enabled</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_CMDS_STARTUP</code></td>
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_CMDS_ON_CONNECT</code></td>
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_CMDS_ON_DISCONNECT</code></td>
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_CMDS_LAST_DISCONNECT</code></td>
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>RCON_CMDS_STARTUP</code></td>
<td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **AUTOPAUSE**
!!! note
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ENABLE_AUTOPAUSE</code></td>
<td>Enable the Autopause functionality</td>
<td><code>FALSE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOPAUSE_TIMEOUT_EST</code></td>
<td>describes the time between the last client disconnect and the pausing of the process</td>
<td><code>3600</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOPAUSE_TIMEOUT_INIT</code></td>
<td>describes the time between server start and the pausing of the process, when no client connects in-between</td>
<td><code>600</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOPAUSE_TIMEOUT_KN</code></td>
<td>describes the time between knocking of the port (e.g. by the main menu ping) and the pausing of the process, when no client connects in-between</td>
<td><code>120</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOPAUSE_PERIOD</code></td>
<td>describes period of the daemonized state machine, that handles the pausing of the process</td>
<td><code>10</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOPAUSE_KNOCK_INTERFACE</code></td>
<td>Describes the interface passed to the knockd daemon. If the default interface does not work, run the ifconfig command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (lo) does likely not yield the desired results.</td>
<td><code>eth0</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>DEBUG_AUTOPAUSE</code></td>
<td>Adds additional debugging output for AutoPause</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **AUTOSTOP**
!!! note
AutoStop function is incompatible with the Autopause functionality, as they basically cancel out each other.
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ENABLE_AUTOSTOP</code></td>
<td>Enable the AutoStop functionality</td>
<td><code>FALSE</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOSTOP_TIMEOUT_EST</code></td>
<td>describes the time between the last client disconnect and the stopping of the server</td>
<td><code>3600</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOSTOP_TIMEOUT_INIT</code></td>
<td>describes the time between server start and the stopping of the server, when no client connects in-between</td>
<td><code>1800</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>AUTOSTOP_PERIOD</code></td>
<td>describes period of the daemonized state machine, that handles the stopping of the serve</td>
<td><code>10</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>DEBUG_AUTOSTOP</code></td>
<td>Adds additional logging for AutoStop</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
### **CURSEFORGE**
!!! note
A CurseForge API key is required to use a CurseForge type server. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable CF_API_KEY
<table>
<thead>
<tr>
<th>NAME</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
<th>REQUIRED</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>CF_API_KEY</code></td>
<td><strong>YOUR</strong> CurseForge (Eternal) API Key.</td>
<td><code></code></td>
<td>✅</td>
</tr>
<tr>
<td><code>CF_PAGE_URL</code></td>
<td>Pass a page URL to the modpack or a specific file</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_SLUG</code></td>
<td>Instead of a URL, the modpack slug can be provided.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_FILE_ID</code></td>
<td>The mod curseforge numerical ID.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_FILENAME_MATCHER</code></td>
<td>Specify a substring to match the desired filename</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_EXCLUDE_INCLUDE_FILE</code></td>
<td>Global and per modpack exclusions can be declared in a JSON file and referenced with this variable. <br /><br />By default, the <a href="https://github.com/itzg/docker-minecraft-server/blob/master/files/cf-exclude-include.json">file bundled with the image</a> will be used, but can be disabled by setting this to an empty string. The schema of this file is <a href="https://github.com/itzg/mc-image-helper#excludeinclude-file-schema">documented here</a>.</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_EXCLUDE_MODS</code></td>
<td>Mods can be excluded by passing a comma or space delimited list of project slugs or IDs</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_FORCE_INCLUDE_MODS</code></td>
<td>Mods can be included by passing a comma or space delimited list of project slugs or IDs</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_FORCE_SYNCHRONIZE</code></td>
<td>Forces the excludes/includes to be re-evaluated</td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_SET_LEVEL_FROM</code></td>
<td>Some modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the LEVEL to the resulting saves directory by setting this to either:
<ul>
<li>WORLD_FILE</li>
<li>OVERRIDES</li>
</ul></td>
<td><code></code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_PARALLEL_DOWNLOADS</code></td>
<td>specify how many parallel mod downloads to perform</td>
<td><code>4</code></td>
<td>⬜️</td>
</tr>
<tr>
<td><code>CF_OVERRIDES_SKIP_EXISTING</code></td>
<td>if set, files in the overrides that already exist in the data directory are skipped. world data is always skipped, if present.</td>
<td><code>false</code></td>
<td>⬜️</td>
</tr>
</tbody>
</table>
<!-- ✅ ⬜️ -->
<!-- <tr>
<td><code></code></td>
<td></td>
<td><code></code></td>
<td>⬜️</td>
</tr> -->

View File

@@ -1,55 +0,0 @@
## Running Minecraft server on different Java version
!!! note
For Forge versions less than 1.18, you _must_ use the `java8-multiarch` (or other java8) image tag.
In general, if you see the following line in a server startup failure, then it means you need to be using Java 8 instead of the latest image Java version:
```
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader
cannot be cast to class java.net.URLClassLoader
```
When using the image `itzg/minecraft-server` without a tag, the `latest` image tag is implied from the table below. To use a different version of Java, please use an alternate tag to run your Minecraft server container. The `stable` tag is similar to `latest`; however, it tracks [the most recent repository release/tag](https://github.com/itzg/docker-minecraft-server/releases/latest).
| Tag name | Java version | Linux | JVM Type | Architecture |
|-------------------|--------------|--------|-------------|-------------------|
| latest | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| stable | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8 | 8 | Alpine | Hotspot | amd64 |
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
| java8-multiarch | 8 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
| java11 | 11 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java11-jdk | 11 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
| java17-jdk | 17 | Ubuntu | Hotspot+JDK | amd64,arm64,armv7 |
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
| java17-graalvm-ce | 17 | Oracle | GraalVM CE | amd64,arm64 |
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
| java20-alpine | 20 | Alpine | Hotspot | amd64 |
| java20 | 20 | Ubuntu | Hotspot | amd64,arm64 |
For example, to use Java version 8 on any supported architecture:
docker run --name mc itzg/minecraft-server:java8-multiarch
!!! note
Keep in mind that some versions of Minecraft server, such as Forge before 1.17, can't work on the newest versions of Java. Instead, one of the Java 8 images should be used. Also, FORGE doesn't support openj9 JVM implementation.
Some versions of vanilla Minecraft, such as 1.10, also do not run correctly with Java 17. If in doubt, use `java8-multiarch` for any version less than 1.17.
### Deprecated Image Tags
The following image tags have been deprecated and are no longer receiving updates:
- java19
- adopt13
- adopt14
- adopt15
- openj9-nightly
- multiarch-latest
- java16/java16-openj9

View File

@@ -1,25 +0,0 @@
To use a different Minecraft version, pass the `VERSION` environment variable (case sensitive), which can have the value
- LATEST (the default)
- SNAPSHOT
- or a specific version, such as "1.7.9"
For example, to use the latest snapshot:
```
docker run -d -e VERSION=SNAPSHOT ...
```
or a specific version:
```
docker run -d -e VERSION=1.7.9 ...
```
When using "LATEST" or "SNAPSHOT" an upgrade can be performed by simply restarting the container.
During the next startup, if a newer version is available from the respective release channel, then
the new server jar file is downloaded and used.
!!! note
Over time you might see older versions of the server jar remain in the `/data` directory. It is safe to remove those.

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

3
examples/.gitignore vendored
View File

@@ -1,3 +0,0 @@
data/
modpacks/
.env

View File

@@ -1,47 +0,0 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
CF_FILENAME_MATCHER: "1.0.6"
MEMORY: 4G
volumes:
- mc-data:/data
- ../downloads:/downloads
# Since Docker's default volume driver creates volumes owned by root, this
# init container will change ownership to match final UID of mc service, above
init-filebrowser:
image: filebrowser/filebrowser
entrypoint: sh -c
command:
- "chown -R 1000: /database"
restart: no
volumes:
- filebrowser-db:/database
filebrowser:
image: filebrowser/filebrowser
depends_on:
init-filebrowser:
condition: service_completed_successfully
user: "1000:1000"
environment:
FB_DATABASE: /database/filebrowser.db
volumes:
# Default FB_ROOT is /srv
# In this example, the left-side needs to be the same as /data volume of mc service
- mc-data:/srv
- filebrowser-db:/database
ports:
- "25580:80"
volumes:
mc-data: {}
filebrowser-db: {}

View File

@@ -1,8 +0,0 @@
{
"port": 80,
"baseURL": "",
"address": "",
"log": "stdout",
"database": "/database/filebrowser.db",
"root": "/srv"
}

View File

@@ -1,21 +0,0 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
MOD_PLATFORM: AUTO_CURSEFORGE
# Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: better-mc-fabric-bmc1
CF_FILENAME_MATCHER: v18.5
MEMORY: 4G
volumes:
- mc:/data
- ../downloads:/downloads
ports:
- "25565:25565"
volumes:
mc: {}

View File

@@ -12,10 +12,7 @@ services:
ENABLE_AUTOPAUSE: "TRUE"
OVERRIDE_SERVER_PROPERTIES: "TRUE"
MAX_TICK_TIME: "-1"
# More aggressive settings for demo purposes
AUTOPAUSE_TIMEOUT_INIT: "30"
AUTOPAUSE_TIMEOUT_EST: "10"
restart: unless-stopped
restart: always
volumes:
mc: {}

Some files were not shown because too many files have changed in this diff Show More