mirror of
https://github.com/itzg/docker-minecraft-server
synced 2025-01-05 16:58:42 +00:00
parent
134eaedf23
commit
f5dbbcc2c6
3 changed files with 12 additions and 6 deletions
|
@ -38,6 +38,6 @@ ENTRYPOINT [ "/start" ]
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
MOTD="A Minecraft Server Powered by Docker" \
|
MOTD="A Minecraft Server Powered by Docker" \
|
||||||
JVM_OPTS="-Xmx1024M -Xms1024M" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MAX_MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
||||||
|
|
|
@ -608,10 +608,11 @@ By default, server checks connecting players against Minecraft's account databas
|
||||||
|
|
||||||
### Memory Limit
|
### Memory Limit
|
||||||
|
|
||||||
The Java memory limit can be adjusted using the `JVM_OPTS` environment variable, where the default is
|
By default the image declares a Java memory limit of 1 GB. That can be adjusted
|
||||||
the setting shown in the example (max and min at 1024 MB):
|
higher (or lower) by setting the `MAX_MEMORY` environment variable. For example,
|
||||||
|
the following increases the memory limit to 8 GB:
|
||||||
|
|
||||||
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
|
docker run -e MAX_MEMORY=8G ...
|
||||||
|
|
||||||
### /data ownership
|
### /data ownership
|
||||||
|
|
||||||
|
|
|
@ -490,6 +490,11 @@ else
|
||||||
EXTRA_ARGS=""
|
EXTRA_ARGS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z $MAX_MEMORY ]]; then
|
||||||
|
# put prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||||
|
JVM_OPTS="-Xms${MAX_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||||
|
fi
|
||||||
|
set -x
|
||||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||||
echo "Running FTB server modpack start ..."
|
echo "Running FTB server modpack start ..."
|
||||||
exec sh ${FTB_SERVER_START}
|
exec sh ${FTB_SERVER_START}
|
||||||
|
@ -497,8 +502,8 @@ 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
|
||||||
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
|
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
|
||||||
else
|
else
|
||||||
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
exec java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue