mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-06-07 11:19:43 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 796d2238da | |||
| d40bbdc3a5 | |||
| 61c291ae4e | |||
| 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 |
@@ -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
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: Build and publish multiarch
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- multiarch
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-buildx:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.2.0
|
||||||
|
- name: Get branch name
|
||||||
|
uses: nelonoel/branch-name@v1
|
||||||
|
- name: Docker Buildx
|
||||||
|
uses: ilteoood/docker_buildx@1.0.4
|
||||||
|
with:
|
||||||
|
publish: true
|
||||||
|
imageName: itzg/minecraft-server
|
||||||
|
tag: ${{ env.BRANCH_NAME }}
|
||||||
|
dockerHubUser: ${{ secrets.DOCKER_USER }}
|
||||||
|
dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM openjdk:8u212-jre-alpine
|
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" \
|
||||||
|
|||||||
@@ -1080,6 +1080,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:
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
@@ -24,4 +24,4 @@ case "X$MODCONFIG" in
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupPlugins $@
|
exec ${SCRIPTS:-/}start-finalSetupMounts $@
|
||||||
|
|||||||
@@ -19,8 +19,13 @@ if isTrue ${REMOVE_OLD_MODS}; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
log "Removing old mods in $remove_mods_dest..."
|
# only try to remove existing mods dir
|
||||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
if [ -d "$remove_mods_dest" ]; then
|
||||||
|
log "Removing old mods in $remove_mods_dest..."
|
||||||
|
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||||
|
else
|
||||||
|
log "Directory $remove_mods_dest does not exist; removing nothing."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||||
|
|||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
|
: ${PLUGINS_SYNC_UPDATE:=true}
|
||||||
|
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
if [ -d /plugins ]; then
|
||||||
|
case ${TYPE} in
|
||||||
|
SPIGOT|BUKKIT|PAPER|MAGMA)
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
log "Copying plugins over..."
|
||||||
|
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
||||||
|
updateArg="--update"
|
||||||
|
fi
|
||||||
|
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||||
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If any modules have been provided, copy them over
|
||||||
|
if [ -d /mods ]; then
|
||||||
|
log "Copying any mods over..."
|
||||||
|
mkdir -p /data/mods
|
||||||
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||||
|
fi
|
||||||
|
|
||||||
|
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||||
|
|
||||||
|
if [ -d /config ]; then
|
||||||
|
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
||||||
|
mkdir -p $COPY_CONFIG_DEST
|
||||||
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
|
||||||
|
|
||||||
: ${PLUGINS_SYNC_UPDATE:=true}
|
|
||||||
|
|
||||||
isDebugging && set -x
|
|
||||||
|
|
||||||
if [ -d /plugins ]; then
|
|
||||||
case ${TYPE} in
|
|
||||||
SPIGOT|BUKKIT|PAPER)
|
|
||||||
mkdir -p /data/plugins
|
|
||||||
log "Copying plugins over..."
|
|
||||||
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
|
||||||
updateArg="--update"
|
|
||||||
fi
|
|
||||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
|
||||||
+17
-16
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
|
||||||
|
|
||||||
if [ -n "$OPS" ]; then
|
if [ -n "$OPS" ]; then
|
||||||
log "Setting/adding ops"
|
log "Setting/adding ops"
|
||||||
rm -rf /data/ops.txt.converted
|
rm -rf /data/ops.txt.converted
|
||||||
@@ -51,20 +49,6 @@ for j in $JSON_FILES; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
|
||||||
if [ -d /mods ]; then
|
|
||||||
log "Copying any mods over..."
|
|
||||||
mkdir -p /data/mods
|
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d /config ]; then
|
|
||||||
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
|
||||||
mkdir -p $COPY_CONFIG_DEST
|
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
|
||||||
fi
|
|
||||||
|
|
||||||
EXTRA_ARGS=""
|
EXTRA_ARGS=""
|
||||||
# Optional disable console
|
# Optional disable console
|
||||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||||
@@ -87,6 +71,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