-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·27 lines (23 loc) · 871 Bytes
/
start.sh
File metadata and controls
executable file
·27 lines (23 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# This simple loop read the template file and writes out the environment
# values to a servers.properties file. Defaults are set in the Dockerfile and
# can be overridden with the `-e` or `--env` flag of `docker run`
#
# e.g.
# docker run \
# --detach \
# --name minecraftserver \
# --publish 25565:25565 \
# --env MOTD="Welcome" \
# minecraft:1.8.6
#
while read SETTING
do
eval echo $SETTING
done < server.properties.template > server.properties
# We now need to allow the user to set their memory limits before starting
# the server. If you are not familiar with Java, be sure to understand that
# the process will use more than MAX_MEM_POOL as this is just the size of the
# JVM's heap. Other bits of the JVM will take up more memory.
CMD="java -Xmx${MAX_MEM_POOL}M -Xms${INITIAL_MEM_POOL}M -jar minecraft_server.jar nogui"
exec $CMD