Skip to content

Commit f8b3500

Browse files
committed
Fix 1.13 download and add PocketMine Support
1 parent d95ec77 commit f8b3500

File tree

9 files changed

+96
-23
lines changed

9 files changed

+96
-23
lines changed

Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ RUN \
4747
/tmp/* \
4848
/var/tmp/*
4949

50-
# Download and install latest jre 8 (Java)
51-
RUN \
52-
echo "**** Install JAVA JDK ****" && \
53-
cd /opt && \
54-
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jre-8u162-linux-x64.tar.gz && \
55-
tar -zxvf jre-8u162-linux-x64.tar.gz && \
56-
update-alternatives --install /usr/bin/java java /opt/jre1.8.0_162/bin/java 1 && \
57-
echo "**** cleanup ****" && \
58-
rm jre-8u162-linux-x64.tar.gz
59-
6050

6151
#########################################
6252
## COPY & RUN SETUP SCRIPT ##

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# [Docker Container for Minecraft][hub]
88

9-
This is a Docker image based on osixia/light-baseimage for running a VANILLA, FORGE, FTB or SPIGOT Minecraft server on Java SE Runtime Environment 8u162 (it is inspired by the awesome work of : [itzg/minecraft-server][itzg]).
9+
This is a Docker image based on osixia/light-baseimage for running a VANILLA, FORGE, FTB or SPIGOT Minecraft server on Java SE Runtime Environment 8u181 (it is inspired by the awesome work of : [itzg/minecraft-server][itzg]).
1010

1111
Minecraft is a sandbox video game created and designed by Swedish game designer Markus "Notch" Persson, and later fully developed and published by Mojang. The creative and building aspects of Minecraft allow players to build with a variety of different cubes in a 3D procedurally generated world. Other activities in the game include exploration, resource gathering, crafting, and combat. [Wikipedia][Minecraft_wikipedia]
1212

service/minecraft/deploy/deploy.sh

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66
export VERSIONS_JSON="https://launchermeta.mojang.com/mc/game/version_manifest.json"
77
export INSTALL_DIR="/opt/minecraft/data"
88

9+
#########################################################################
10+
# Function : installJAVA
11+
# Purpose : Install JAVA 8
12+
# Remarks : -
13+
#########################################################################
14+
function installJAVA {
15+
# Download and install latest jre 8 (Java)
16+
echo "**** Install JAVA JRE 8 ****"
17+
cd /opt
18+
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jre-8u181-linux-x64.tar.gz
19+
tar -zxvf jre-8u181-linux-x64.tar.gz
20+
update-alternatives --install /usr/bin/java java /opt/jre1.8.0_181/bin/java 1
21+
echo "**** cleanup ****"
22+
rm jre-8u181-linux-x64.tar.gz
23+
}
24+
25+
926
#########################################
1027
## MINECRAFT EULA ##
1128
#########################################
@@ -48,24 +65,49 @@ esac
4865
echo "[$(date +"%H:%M:%S")] [Container Setup]: Deploying a '$TYPE' Minecraft server"
4966
case "$TYPE" in
5067
SPIGOT|spigot)
51-
exec /container/service/minecraft/deploy/deploy_SPIGOT.sh
68+
installJAVA
69+
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy_SPIGOT.sh
5270
;;
5371

5472
FORGE|forge)
55-
exec /container/service/minecraft/deploy/deploy_FORGE.sh
73+
installJAVA
74+
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy_FORGE.sh
5675
;;
5776

5877
FTB|ftb)
59-
exec /container/service/minecraft/deploy/deploy_FTB.sh
78+
installJAVA
79+
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy_FTB.sh
6080
;;
6181

6282
VANILLA|vanilla)
63-
exec /container/service/minecraft/deploy/deploy_VANILLA.sh
83+
installJAVA
84+
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy_VANILLA.sh
85+
;;
86+
87+
POCKETMINE|pocketmine)
88+
echo "**** Install extra Dependencies ****"
89+
apt-get update
90+
apt-get install --no-install-recommends -y \
91+
make \
92+
autoconf \
93+
automake \
94+
m4 \
95+
bzip2 \
96+
bison \
97+
g++ \
98+
libtool-bin
99+
echo "**** cleanup ****"
100+
apt-get clean
101+
rm -rf \
102+
/var/lib/apt/lists/* \
103+
/tmp/* \
104+
/var/tmp/*
105+
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy_POCKETMINE.sh
64106
;;
65107

66108
*)
67109
echo "Invalid type: '$TYPE'"
68-
echo "Valid types: VANILLA|FORGE|SPIGOT|FTB"
110+
echo "Valid types: VANILLA|FORGE|SPIGOT|FTB|POCKETMINE"
69111
exit
70112
;;
71113
esac

service/minecraft/deploy/deploy_FinalSetup.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,14 @@ fi
142142

143143

144144
#########################################
145-
## JAVA MEMORY SETTINGS ##
145+
## JAVA/PHP MEMORY SETTINGS ##
146146
#########################################
147-
echo "[$(date +"%H:%M:%S")] [Container Setup]: Setting min JAVA allocated memory to $JVM_MIN_MEM and max to $JVM_MAX_MEM"
148-
JVM_OPTS="-Xms$JVM_MIN_MEM -Xmx$JVM_MAX_MEM $JVM_OPTS"
147+
if [ ! -z $PM_SERVER_START ]; then
148+
echo "[$(date +"%H:%M:%S")] [Container Setup]: Setting PHP"
149+
else
150+
echo "[$(date +"%H:%M:%S")] [Container Setup]: Setting min JAVA allocated memory to $JVM_MIN_MEM and max to $JVM_MAX_MEM"
151+
JVM_OPTS="-Xms$JVM_MIN_MEM -Xmx$JVM_MAX_MEM $JVM_OPTS"
152+
fi
149153

150154

151155
#########################################
@@ -166,3 +170,8 @@ if [ ! -z $FTB_SERVER_START ]; then
166170
if [ ! -z "$JVM_XX_OPTS" ]; then echo "export JAVA_PARAMETERS=\"$JVM_XX_OPTS\"" >> $INSTALL_DIR/settings-local.sh;fi
167171
fi
168172

173+
# POCKETMINE Export
174+
if [ ! -z $PM_SERVER_START ]; then
175+
echo $PM_SERVER_START >> /container/environment/PM_SERVER_START
176+
fi
177+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
###############
4+
## CONSTANTS ##
5+
###############
6+
POCKETMINE_DOWNLOAD="https://get.pmmp.io"
7+
8+
#########################################
9+
## DOWNLOAD AND INSTALL POCKETMINE ##
10+
#########################################
11+
cd $INSTALL_DIR
12+
curl -sL $POCKETMINE_DOWNLOAD | bash -s -
13+
export PM_SERVER_START=$INSTALL_DIR/start.sh
14+
15+
#########################################
16+
## FINAL SETUP ##
17+
#########################################
18+
exec /container/service/minecraft/deploy/deploy_FinalSetup.sh
19+

service/minecraft/deploy/deploy_VANILLA.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
## CONSTANTS ##
55
###############
66
export SERVER="minecraft_server.$VANILLA_VERSION.jar"
7-
MINECRAFT_DOWNLOAD="https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER"
7+
case "$VANILLA_VERSION" in
8+
1.13)
9+
MINECRAFT_DOWNLOAD="https://launcher.mojang.com/mc/game/1.13/server/d0caafb8438ebd206f99930cfaecfa6c9a13dca0/server.jar"
10+
;;
11+
*)
12+
MINECRAFT_DOWNLOAD="https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER"
13+
14+
;;
15+
esac
816

917
#########################################
1018
## DOWNLOAD MINECRAFT ##
@@ -13,7 +21,7 @@ MINECRAFT_DOWNLOAD="https://s3.amazonaws.com/Minecraft.Download/versions/$VANILL
1321
if [ ! -e $SERVER ]; then
1422
echo "[$(date +"%H:%M:%S")] [Container Setup]: Downloading $SERVER ..."
1523
cd $INSTALL_DIR
16-
wget -q $MINECRAFT_DOWNLOAD
24+
wget -q -O $SERVER $MINECRAFT_DOWNLOAD
1725
fi
1826

1927
#########################################

service/minecraft/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ chown -R docker:docker \
2121

2222
# Ensure the docker user can export to container ENV
2323
chmod -R 757 /container/environment \
24+

service/minecraft/process.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ cd $INSTALL_DIR
88
if [ ! -z $FTB_SERVER_START ]; then
99
exec /sbin/setuser docker $FTB_SERVER_START
1010
else
11-
exec /sbin/setuser docker java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER nogui
11+
if [ ! -z $PM_SERVER_START ]; then
12+
exec /sbin/setuser docker $PM_SERVER_START
13+
else
14+
exec /sbin/setuser docker java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER nogui
15+
fi
1216
fi

service/minecraft/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ ! -f "/etc/initialbootpassed" ]; then
3434
## DEPLOY MINECRAFT ##
3535
#########################################
3636

37-
exec /sbin/setuser docker /container/service/minecraft/deploy/deploy.sh
37+
exec /container/service/minecraft/deploy/deploy.sh
3838

3939
else
4040
echo "[$(date +"%H:%M:%S")] [Container Setup]: -------> Standard boot"

0 commit comments

Comments
 (0)