mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-03-02 21:06:27 +00:00
Compare commits
36 Commits
2021.3.0-j
...
2021.2.0-o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3542e9e0b | ||
|
|
23c0cd3017 | ||
|
|
84bc92975c | ||
|
|
5739b74aa3 | ||
|
|
796d2238da | ||
|
|
d919881092 | ||
|
|
e406fee8fa | ||
|
|
3497b06391 | ||
|
|
65b0e0d8bb | ||
|
|
c5b9c199d6 | ||
|
|
5a61465c09 | ||
|
|
8a324c30de | ||
|
|
e0cdf9e2ce | ||
|
|
57740cb749 | ||
|
|
966c74cd08 | ||
|
|
d84b58dfd0 | ||
|
|
7aaf106ffe | ||
|
|
5f77902441 | ||
|
|
c200efc9c9 | ||
|
|
e924126a56 | ||
|
|
bbd3d3cfc1 | ||
|
|
d77c19c69b | ||
|
|
7ee77e4f47 | ||
|
|
84d0cff4c8 | ||
|
|
70519b9764 | ||
|
|
4683ea496d | ||
|
|
0e3a82f9d3 | ||
|
|
d2554f2271 | ||
|
|
55e62371ac | ||
|
|
c9a5fcfac8 | ||
|
|
a1f8154d05 | ||
|
|
e5d0a9362a | ||
|
|
ca9c280b0b | ||
|
|
6ef4e984c7 | ||
|
|
ea4f78346a | ||
|
|
007f9426bf |
25
.circleci/config.yml
Normal file
25
.circleci/config.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
minecraft_server:
|
||||||
|
docker:
|
||||||
|
- image: circleci/buildpack-deps:stable
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup_remote_docker
|
||||||
|
- run:
|
||||||
|
name: Build image
|
||||||
|
command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH} .
|
||||||
|
# - run:
|
||||||
|
# name: Build arm v7 image
|
||||||
|
# command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH}-arm-v7 --platform linux/arm/v7 --build-arg ARCH=armv7 .
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build:
|
||||||
|
jobs:
|
||||||
|
- minecraft_server:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- armv7
|
||||||
|
- multiarch
|
||||||
75
.github/workflows/build-multiarch.yml
vendored
75
.github/workflows/build-multiarch.yml
vendored
@@ -3,78 +3,23 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- multiarch
|
- multiarch
|
||||||
- java8-multiarch
|
|
||||||
- multiarch-latest
|
|
||||||
- java15
|
|
||||||
- test/multiarch/*
|
|
||||||
tags:
|
tags:
|
||||||
- "[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]+-java15"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-buildx:
|
docker-buildx:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.2.0
|
uses: actions/checkout@v2.2.0
|
||||||
|
- name: Get branch name
|
||||||
- name: Prepare
|
uses: nelonoel/branch-name@v1
|
||||||
id: prep
|
- name: Docker Buildx
|
||||||
run: |
|
uses: ilteoood/docker_buildx@1.0.4
|
||||||
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
|
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
publish: true
|
||||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
imageName: itzg/minecraft-server
|
||||||
restore-keys: |
|
tag: ${{ env.BRANCH_NAME }}
|
||||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
dockerHubUser: ${{ secrets.DOCKER_USER }}
|
||||||
|
dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
|
|
||||||
- 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
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
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.source=https://github.com/itzg/docker-minecraft-server
|
|
||||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
|
||||||
org.opencontainers.image.revision=${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
|||||||
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
@@ -4,18 +4,23 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- java8
|
|
||||||
- openj9
|
- openj9
|
||||||
- openj9-11
|
- openj9-11
|
||||||
|
- openj9-nightly
|
||||||
- adopt11
|
- adopt11
|
||||||
|
- adopt13
|
||||||
|
- adopt14
|
||||||
|
- adopt15
|
||||||
- test/*
|
- test/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[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"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-adopt14"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-adopt15"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM adoptopenjdk/openjdk11:alpine-jre
|
FROM adoptopenjdk/openjdk8-openj9:alpine
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ COPY log4j2.xml /tmp/log4j2.xml
|
|||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
|
|||||||
66
README.md
66
README.md
@@ -160,31 +160,24 @@ the server jar remain in the `/data` directory. It is safe to remove those._
|
|||||||
|
|
||||||
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 | Description | Linux |
|
||||||
| -------------- | -------------|--------|----------|-------------------|
|
| -------------- | ------------------------------------------- | ------------ |
|
||||||
| latest | 11 | Alpine | Hotspot | amd64 |
|
| latest | **Default**. Uses Java version 8 | Alpine Linux |
|
||||||
| java8 | 8 | Alpine | Hotspot | amd64 |
|
| adopt15 | Uses Java version 15 from AdoptOpenJDK | Alpine Linux |
|
||||||
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
| adopt14 | Uses Java version 14 from AdoptOpenJDK | Alpine Linux |
|
||||||
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
| adopt13 | Uses Java version 13 from AdoptOpenJDK | Alpine Linux |
|
||||||
| adopt11 | 11 | Alpine | Hotspot | amd64 |
|
| adopt11 | Uses Java version 11 from AdoptOpenJDK | Alpine Linux |
|
||||||
| openj9 | 8 | Alpine | OpenJ9 | amd64 |
|
| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux |
|
||||||
| openj9-11 | 11 | Alpine | OpenJ9 | amd64 |
|
| openj9-11 | Uses Eclipse OpenJ9 JVM for Java 11 | Alpine Linux |
|
||||||
| multiarch | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux |
|
||||||
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
| multiarch | Uses Java version 8 latest update | Debian Linux |
|
||||||
|
| multiarch-latest | Uses Java version 15 latest update | Debian Linux |
|
||||||
|
|
||||||
For example, to use Java version 15 on any supported architecture:
|
For example, to use a Java version 13:
|
||||||
|
|
||||||
docker run --name mc itzg/minecraft-server:java15
|
docker run --name mc itzg/minecraft-server:adopt13
|
||||||
|
|
||||||
> Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation.
|
Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation.
|
||||||
|
|
||||||
### Deprecated Image Tags
|
|
||||||
|
|
||||||
The following image tags have been deprecated and are no longer receiving updates:
|
|
||||||
- adopt13
|
|
||||||
- adopt14
|
|
||||||
- adopt15
|
|
||||||
- openj9-nightly
|
|
||||||
|
|
||||||
## Healthcheck
|
## Healthcheck
|
||||||
|
|
||||||
@@ -515,7 +508,7 @@ A [Catserver](http://catserver.moe/) type server can be used with
|
|||||||
|
|
||||||
## Running a server with a Feed the Beast modpack
|
## Running a server with a Feed the Beast modpack
|
||||||
|
|
||||||
> **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version).
|
> **NOTE** requires `itzg/minecraft-server:multiarch` image
|
||||||
|
|
||||||
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by using `-e TYPE=FTBA` (**note** the "A" at the end of the type). This server 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.
|
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by using `-e TYPE=FTBA` (**note** the "A" at the end of the type). This server 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.
|
||||||
|
|
||||||
@@ -965,7 +958,7 @@ environment variable set to `false`, such as
|
|||||||
### Level Type and Generator Settings
|
### Level Type and Generator Settings
|
||||||
|
|
||||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
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, for example
|
be configured by setting `LEVEL_TYPE` to an expected type, such as
|
||||||
|
|
||||||
- DEFAULT
|
- DEFAULT
|
||||||
- FLAT
|
- FLAT
|
||||||
@@ -973,8 +966,6 @@ be configured by setting `LEVEL_TYPE` to an expected type, for example
|
|||||||
- AMPLIFIED
|
- AMPLIFIED
|
||||||
- CUSTOMIZED
|
- CUSTOMIZED
|
||||||
- BUFFET
|
- BUFFET
|
||||||
- BIOMESOP (Biomes O' Plenty for 1.12 and older)
|
|
||||||
- BIOMESOPLENTY (Biomes O' Plenty for 1.15 and above)
|
|
||||||
|
|
||||||
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
|
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
|
||||||
|
|
||||||
@@ -1105,18 +1096,19 @@ is passed to `docker run`.
|
|||||||
|
|
||||||
### Memory Limit
|
### 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:
|
By default, the image declares a Java initial and maximum memory 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
|
- `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`)
|
||||||
- `INIT_MEMORY`: independently sets the initial heap size
|
memory settings of the JVM
|
||||||
- `MAX_MEMORY`: independently sets the max heap size
|
- `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:
|
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
|
-e MEMORY=2G
|
||||||
|
|
||||||
> NOTE: 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).
|
|
||||||
|
|
||||||
### JVM Options
|
### JVM Options
|
||||||
|
|
||||||
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
|
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
|
||||||
@@ -1126,6 +1118,14 @@ via a `JVM_XX_OPTS` environment variable.
|
|||||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||||
|
|
||||||
|
The container uses [OpenJ9](https://www.eclipse.org/openj9/docs) and a couple of J9 options are
|
||||||
|
simplified by environment variables:
|
||||||
|
|
||||||
|
- `-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%.
|
||||||
|
|
||||||
### Enable Remote JMX for Profiling
|
### Enable Remote JMX for Profiling
|
||||||
|
|
||||||
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as:
|
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#set -x
|
#set -x
|
||||||
# Use this variable to indicate a list of branches that docker hub is watching
|
# Use this variable to indicate a list of branches that docker hub is watching
|
||||||
branches_list=('java8' 'java8-multiarch' 'openj9' 'openj9-11' 'adopt11' 'java15' 'multiarch' 'multiarch-latest')
|
branches_list=('openj9' 'openj9-11' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'adopt15' 'multiarch' 'multiarch-latest')
|
||||||
|
|
||||||
function TrapExit {
|
function TrapExit {
|
||||||
echo "Checking out back in master"
|
echo "Checking out back in master"
|
||||||
|
|||||||
@@ -95,10 +95,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
FORGE)
|
||||||
log "**********************************************************************"
|
|
||||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
|
||||||
log " since some mods require Java 8"
|
|
||||||
log "**********************************************************************"
|
|
||||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,23 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if isTrue ${TUNE_VIRTUALIZED}; then
|
||||||
|
JVM_XX_OPTS="${JVM_XX_OPTS} -Xtune:virtualized"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if isTrue ${TUNE_NURSERY_SIZES}; then
|
||||||
|
case ${MAX_MEMORY^^} in
|
||||||
|
*G)
|
||||||
|
MAX_MEMORY_MB=$(( ${MAX_MEMORY%?} * 1024 )) ;;
|
||||||
|
*M)
|
||||||
|
MAX_MEMORY_MB=${MAX_MEMORY%?} ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
NURSERY_MINIMUM=$(( ${MAX_MEMORY_MB} / 2 ))
|
||||||
|
NURSERY_MAXIMUM=$(( ${MAX_MEMORY_MB} * 4/5 ))
|
||||||
|
JVM_XX_OPTS="${JVM_XX_OPTS} -Xmns${NURSERY_MINIMUM}M -Xmnx${NURSERY_MAXIMUM}M"
|
||||||
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_JMX}; then
|
if isTrue ${ENABLE_JMX}; then
|
||||||
: ${JMX_HOST:=0.0.0.0}
|
: ${JMX_HOST:=0.0.0.0}
|
||||||
: ${JMX_PORT:=7091}
|
: ${JMX_PORT:=7091}
|
||||||
|
|||||||
Reference in New Issue
Block a user