mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-22 02:38:13 +00:00
[mc] Enable graceful shutdown on stop
This commit is contained in:
1 parent
767fa4962b
commit
35ec677446
2 files changed
+9
-7
No files matched your search
@@ -28,6 +28,9 @@ EXPOSE 25565 25575
|
|||||||
|
|
||||||
ADD https://github.com/itzg/restify/releases/download/1.0.4/restify_linux_amd64 /usr/local/bin/restify
|
ADD https://github.com/itzg/restify/releases/download/1.0.4/restify_linux_amd64 /usr/local/bin/restify
|
||||||
ADD https://github.com/itzg/rcon-cli/releases/download/1.3/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
|
ADD https://github.com/itzg/rcon-cli/releases/download/1.3/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
|
||||||
|
ADD https://github.com/itzg/mc-server-runner/releases/download/1.1.0/mc-server-runner_1.1.0_linux_amd64.tar.gz /tmp
|
||||||
|
RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner_1.1.0_linux_amd64.tar.gz mc-server-runner && \
|
||||||
|
rm /tmp/mc-server-runner_1.1.0_linux_amd64.tar.gz
|
||||||
COPY mcadmin.jq /usr/share
|
COPY mcadmin.jq /usr/share
|
||||||
RUN chmod +x /usr/local/bin/*
|
RUN chmod +x /usr/local/bin/*
|
||||||
|
|
||||||
@@ -44,4 +47,4 @@ ENV JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
|||||||
|
|
||||||
COPY start* /
|
COPY start* /
|
||||||
|
|
||||||
USER minecraft
|
USER minecraft
|
||||||
@@ -91,13 +91,12 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
|||||||
|
|
||||||
cd ${FTB_DIR}
|
cd ${FTB_DIR}
|
||||||
echo "Running FTB server modpack start ..."
|
echo "Running FTB server modpack start ..."
|
||||||
exec ${FTB_SERVER_START}
|
exec mc-server-runner ${FTB_SERVER_START}
|
||||||
else
|
else
|
||||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||||
if [ -f /data/bootstrap.txt ];
|
if [ -f /data/bootstrap.txt ]; then
|
||||||
then
|
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||||
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
|
|
||||||
else
|
|
||||||
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user