mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-02 21:52:17 +00:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbdb2c9b36 | ||
|
|
48e09f42fc | ||
|
|
ec7d182d38 | ||
|
|
9c7c95cf4f | ||
|
|
e32ffd1819 | ||
|
|
095c6ad099 | ||
|
|
14342c9632 | ||
|
|
f6df4d6694 | ||
|
|
0406e89c2a | ||
|
|
5ef21e1ddf | ||
|
|
414d5bd8ac | ||
|
|
15ccf03b28 | ||
|
|
828a48998f | ||
|
|
4b590e03ff | ||
|
|
0db8780ad9 | ||
|
|
5b744176df | ||
|
|
20b15e0330 | ||
|
|
818539e3de | ||
|
|
f48741f65c | ||
|
|
e9e5af849f | ||
|
|
22d68f5c7c | ||
|
|
690598da60 |
@@ -1,17 +1,16 @@
|
|||||||
version: 2
|
version: 2.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
minecraft_server:
|
minecraft_server:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/buildpack-deps:stable
|
- image: docker:18.09.6
|
||||||
|
environment:
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker
|
- setup_remote_docker:
|
||||||
- run:
|
version: 18.09.3
|
||||||
name: Build image
|
- run: docker build --platform linux/amd64,linux/arm64,linux/arm/v7 -t itzg/minecraft-server:multiarch .
|
||||||
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:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|||||||
+19
-21
@@ -1,36 +1,34 @@
|
|||||||
FROM adoptopenjdk/openjdk8-openj9:alpine
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
LABEL maintainer "itzg"
|
||||||
|
|
||||||
RUN apk add --no-cache -U \
|
RUN apt-get update \
|
||||||
openssl \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
imagemagick \
|
apt-get install -y \
|
||||||
lsof \
|
openjdk-8-jre-headless \
|
||||||
su-exec \
|
imagemagick \
|
||||||
shadow \
|
gosu \
|
||||||
bash \
|
curl wget \
|
||||||
curl iputils wget \
|
jq \
|
||||||
git \
|
dos2unix \
|
||||||
jq \
|
mysql-client \
|
||||||
mysql-client \
|
tzdata \
|
||||||
tzdata \
|
rsync \
|
||||||
rsync \
|
nano \
|
||||||
nano
|
&& apt-get clean
|
||||||
|
|
||||||
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
EXPOSE 25565 25575
|
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=linux
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH=arm
|
||||||
ARG TARGETVARIANT=""
|
ARG TARGETVARIANT=v7
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -1077,14 +1077,6 @@ via a `JVM_XX_OPTS` environment variable.
|
|||||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if [ $(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} /start-configuration $@
|
exec gosu ${runAsUser}:${runAsGroup} /start-configuration $@
|
||||||
else
|
else
|
||||||
exec /start-configuration $@
|
exec /start-configuration $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-9
@@ -7,6 +7,8 @@ shopt -s nullglob
|
|||||||
#umask 002
|
#umask 002
|
||||||
export HOME=/data
|
export HOME=/data
|
||||||
|
|
||||||
|
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||||
|
|
||||||
if [ ! -e /data/eula.txt ]; then
|
if [ ! -e /data/eula.txt ]; then
|
||||||
EULA="${EULA,,}"
|
EULA="${EULA,,}"
|
||||||
if [ "$EULA" != "true" ]; then
|
if [ "$EULA" != "true" ]; then
|
||||||
@@ -28,15 +30,6 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
|
||||||
|
|
||||||
if ! touch /data/.verify_access; then
|
|
||||||
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm /data/.verify_access || true
|
|
||||||
|
|
||||||
if [[ $PROXY ]]; then
|
if [[ $PROXY ]]; then
|
||||||
export http_proxy="$PROXY"
|
export http_proxy="$PROXY"
|
||||||
export https_proxy="$PROXY"
|
export https_proxy="$PROXY"
|
||||||
|
|||||||
@@ -100,23 +100,6 @@ 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