mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 15:36:22 +00:00
Compare commits
27 Commits
2021.14.0-
...
2021.12.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49d89d3e73 | ||
|
|
74203b23f4 | ||
|
|
4fb791b490 | ||
|
|
ced25ad50a | ||
|
|
48efc224ba | ||
|
|
467c1d9954 | ||
|
|
9ced230f55 | ||
|
|
f3a8276362 | ||
|
|
b91d63716e | ||
|
|
46cccfd531 | ||
|
|
9fe1cb4a0d | ||
|
|
076038b470 | ||
|
|
aa416729ea | ||
|
|
812c6365ec | ||
|
|
42a5131b19 | ||
|
|
624f6a210f | ||
|
|
1c63cd18b7 | ||
|
|
6266a7e3cc | ||
|
|
871ecd4d9d | ||
|
|
c572c95161 | ||
|
|
f7b58fbbb1 | ||
|
|
eccfa444a9 | ||
|
|
e831d25706 | ||
|
|
12e931332b | ||
|
|
ceee9eddc9 | ||
|
|
60ba668743 | ||
|
|
fd1b15e01f |
32
.github/workflows/build-multiarch.yml
vendored
32
.github/workflows/build-multiarch.yml
vendored
@@ -2,22 +2,18 @@ name: Build and publish multiarch
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- multiarch
|
||||||
- "*-multiarch"
|
- multiarch-latest
|
||||||
- "multiarch*"
|
- java*
|
||||||
- java8-openj9
|
|
||||||
- java11*
|
|
||||||
- java15*
|
|
||||||
- java16*
|
|
||||||
- test/multiarch/*
|
- test/multiarch/*
|
||||||
|
branches-ignore:
|
||||||
|
- java8
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
|
- "[0-9]+.[0-9]+.[0-9]+-java*"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
|
tags-ignore:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java11*"
|
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java16*"
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "*.md"
|
- "*.md"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
@@ -26,8 +22,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
docker-buildx:
|
docker-buildx:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
env:
|
|
||||||
CACHE_NAME: master
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
@@ -41,7 +35,6 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=edge,branch=master
|
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
@@ -50,10 +43,9 @@ jobs:
|
|||||||
uses: actions/cache@v2.1.5
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
|
${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-
|
||||||
${{ runner.os }}-buildx-
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.1.0
|
uses: docker/setup-qemu-action@v1.1.0
|
||||||
|
|||||||
2
.github/workflows/generate-toc.yml
vendored
2
.github/workflows/generate-toc.yml
vendored
@@ -17,4 +17,4 @@ jobs:
|
|||||||
./gh-md-toc --insert --no-backup README.md
|
./gh-md-toc --insert --no-backup README.md
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
|
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
|
||||||
with:
|
with:
|
||||||
commit_message: "docs: Auto update markdown TOC"
|
commit_message: Auto update markdown TOC
|
||||||
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -3,12 +3,14 @@ name: Build and Publish
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- master
|
||||||
- java8
|
- java8
|
||||||
- openj9
|
- openj9
|
||||||
- openj9-11
|
- openj9-11
|
||||||
- adopt11
|
- adopt11
|
||||||
- test/*
|
- test/*
|
||||||
tags:
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||||
@@ -29,8 +31,6 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
env:
|
|
||||||
CACHE_NAME: master
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.3.4
|
||||||
@@ -62,9 +62,9 @@ jobs:
|
|||||||
uses: actions/cache@v2.1.5
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-
|
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
|
|||||||
38
Dockerfile
38
Dockerfile
@@ -1,29 +1,29 @@
|
|||||||
FROM openjdk:8u212-jre-alpine
|
FROM adoptopenjdk:8-jre-hotspot
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
RUN apk add --no-cache -U \
|
RUN apt-get update \
|
||||||
openssl \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get install -y \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
lsof \
|
gosu \
|
||||||
su-exec \
|
sudo \
|
||||||
shadow \
|
net-tools \
|
||||||
bash \
|
curl wget \
|
||||||
curl iputils wget \
|
|
||||||
git \
|
git \
|
||||||
jq \
|
jq \
|
||||||
|
dos2unix \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
tzdata \
|
tzdata \
|
||||||
rsync \
|
rsync \
|
||||||
nano \
|
nano \
|
||||||
sudo \
|
unzip \
|
||||||
knock \
|
knockd \
|
||||||
ttf-dejavu
|
ttf-dejavu \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
RUN addgroup -g 1000 minecraft \
|
RUN addgroup --gid 1000 minecraft \
|
||||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||||
&& mkdir -m 777 /data \
|
|
||||||
&& chown minecraft:minecraft /data /home/minecraft
|
|
||||||
|
|
||||||
COPY files/sudoers* /etc/sudoers.d
|
COPY files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ EXPOSE 25565 25575
|
|||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT=""
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
ARG EASY_ADD_VER=0.7.1
|
ARG EASY_ADD_VER=0.7.1
|
||||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
@@ -69,7 +69,7 @@ WORKDIR /data
|
|||||||
STOPSIGNAL SIGTERM
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST \
|
TYPE=VANILLA VERSION=LATEST \
|
||||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -143,7 +143,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Enabling Autopause](#enabling-autopause)
|
* [Enabling Autopause](#enabling-autopause)
|
||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Sat May 22 03:44:26 UTC 2021 -->
|
<!-- Added by: runner, at: Thu May 20 01:17:11 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -268,20 +268,22 @@ the server jar remain in the `/data` directory. It is safe to remove those._
|
|||||||
|
|
||||||
## Running Minecraft server on different Java version
|
## Running Minecraft server on different Java version
|
||||||
|
|
||||||
|
> **NOTE** [as of snapshot 21W19A](https://www.minecraft.net/en-us/article/minecraft-snapshot-21w19a), Java 16 is now required. Please use `itzg/minecraft-server:java16` for that version and newer. Consideration of changing the `latest` will be made after 1.17 releases.
|
||||||
|
|
||||||
To use a different version of Java, please use a docker tag to run your Minecraft server.
|
To use a different version of Java, please use a docker tag to run your Minecraft server.
|
||||||
|
|
||||||
| Tag name | Java version | Linux | JVM Type | Architecture |
|
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||||
| -------------- | -------------|--------|----------|-------------------|
|
| -------------- | -------------|--------|----------|-------------------|
|
||||||
| latest | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
| latest | 11 | Alpine | Hotspot | amd64 |
|
||||||
| edge | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
|
||||||
| java8 | 8 | Alpine | Hotspot | amd64 |
|
| java8 | 8 | Alpine | Hotspot | amd64 |
|
||||||
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
|
|
||||||
| java11 | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
|
||||||
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
|
||||||
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
|
| java15-openj9 | 15 | Debian | OpenJ9 | amd64,arm64 |
|
||||||
| java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
| java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| java16-openj9 | 16 | Debian | OpenJ9 | amd64 |
|
| adopt11 | 11 | Alpine | Hotspot | amd64 |
|
||||||
|
| openj9 | 8 | Alpine | OpenJ9 | amd64 |
|
||||||
|
| openj9-11 | 11 | Alpine | OpenJ9 | amd64 |
|
||||||
|
| multiarch | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
||||||
|
|
||||||
For example, to use Java version 15 on any supported architecture:
|
For example, to use Java version 15 on any supported architecture:
|
||||||
@@ -464,7 +466,7 @@ A [Magma](https://magmafoundation.org/) server, which is a combination of Forge
|
|||||||
|
|
||||||
### Running a Mohist server
|
### Running a Mohist server
|
||||||
|
|
||||||
A [Mohist](https://github.com/MohistMC/Mohist) server can be used with
|
A [Mohist](https://github.com/Mohist-Community/Mohist) server can be used with
|
||||||
|
|
||||||
-e TYPE=MOHIST
|
-e TYPE=MOHIST
|
||||||
|
|
||||||
@@ -1334,7 +1336,9 @@ The following environment variables define the behaviour of auto-pausing:
|
|||||||
|
|
||||||
## Running on RaspberryPi
|
## Running on RaspberryPi
|
||||||
|
|
||||||
To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags [list in the Java version section](#running-minecraft-server-on-different-java-version) that specify `armv7` for the architecture, which includes `itzg/minecraft-server:latest`.
|
To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags [list in the Java version section](#running-minecraft-server-on-different-java-version) that specify `armv7` for the architecture, such as
|
||||||
|
|
||||||
|
itzg/minecraft-server:multiarch
|
||||||
|
|
||||||
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,13 @@
|
|||||||
branches_list=(
|
branches_list=(
|
||||||
'java8'
|
'java8'
|
||||||
'java8-multiarch'
|
'java8-multiarch'
|
||||||
'java8-openj9'
|
'openj9'
|
||||||
'java11'
|
'openj9-11'
|
||||||
'java11-openj9'
|
'adopt11'
|
||||||
'java15'
|
'java15'
|
||||||
|
'java15-openj9'
|
||||||
'java16'
|
'java16'
|
||||||
'java16-openj9'
|
'multiarch'
|
||||||
'multiarch-latest'
|
'multiarch-latest'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
2
start
2
start
@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
|||||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||||
else
|
else
|
||||||
exec ${SCRIPTS:-/}start-configuration $@
|
exec ${SCRIPTS:-/}start-configuration $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ fi
|
|||||||
|
|
||||||
if ! which java > /dev/null; then
|
if ! which java > /dev/null; then
|
||||||
log "Fixing PATH to include java"
|
log "Fixing PATH to include java"
|
||||||
PATH="${PATH}:/usr/bin"
|
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
@@ -105,6 +105,10 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
FTBA)
|
||||||
|
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ isDebugging && set -x
|
|||||||
requireVar VANILLA_VERSION
|
requireVar VANILLA_VERSION
|
||||||
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
||||||
|
|
||||||
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
||||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||||
|
|
||||||
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
||||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -26,7 +26,7 @@ buildRelPath=$(
|
|||||||
baseName=$(basename "${buildRelPath}")
|
baseName=$(basename "${buildRelPath}")
|
||||||
if [[ ${baseName} != *-server.jar* ]]; then
|
if [[ ${baseName} != *-server.jar* ]]; then
|
||||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||||
log " and set VERSION accordingly"
|
log " and set VERSION accordingly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -246,4 +246,3 @@ else
|
|||||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}"
|
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
args:
|
|
||||||
TARGETOS: linux
|
|
||||||
TARGETARCH: amd64
|
|
||||||
cache_from:
|
cache_from:
|
||||||
- itzg/minecraft-server:latest
|
- itzg/minecraft-server:latest
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user