feat(minecraft-server): add server-name to env variables

The server-name (e.g. needed for bungeecord) can now
be set via the env variable SERVER_NAME.
Defaults to Unknown
This commit is contained in:
Michael Reichenbach 2019-01-12 16:32:30 +01:00
parent bd084cc261
commit f6465b5dac
3 changed files with 20 additions and 14 deletions

View File

@ -3,19 +3,19 @@ FROM openjdk:8u171-jre-alpine
LABEL maintainer "itzg"
RUN apk add --no-cache -U \
openssl \
imagemagick \
lsof \
su-exec \
shadow \
bash \
curl iputils wget \
git \
jq \
mysql-client \
tzdata \
rsync \
python python-dev py2-pip
openssl \
imagemagick \
lsof \
su-exec \
shadow \
bash \
curl iputils wget \
git \
jq \
mysql-client \
tzdata \
rsync \
python python-dev py2-pip
RUN pip install mcstatus
@ -71,7 +71,7 @@ ENV UID=1000 GID=1000 \
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME=Unknown
COPY start* /
RUN dos2unix /start* && chmod +x /start*

View File

@ -435,6 +435,11 @@ this server instance.
## Server configuration
### Server name
The server name (e.g. for bungeecord) can be set like:
docker run -d -e SERVER_NAME=MyServer ...
### Server port
The server port can be set like:

View File

@ -50,6 +50,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
MOTD="A ${label} Minecraft Server powered by Docker"
fi
setServerProp "server-name" "$SERVER_NAME"
setServerProp "server-port" "$SERVER_PORT"
setServerProp "motd" "$MOTD"
setServerProp "allow-nether" "$ALLOW_NETHER"