Adding minecraft server image

This commit is contained in:
Geoff Bourne 2014-06-02 02:38:32 +00:00
parent 97ebcb0fd9
commit a1d922057a
3 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,25 @@
FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
RUN apt-get update
RUN apt-get install -y wget libmozjs-24-bin
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
RUN chmod +x /usr/bin/jsawk
EXPOSE 25565
ADD run.sh /run
VOLUME ['/data']
ADD server.properties /tmp/server.properties
WORKDIR /data
ENTRYPOINT /run
ENV MOTD A Minecraft Server Powered by Docker
ENV LEVEL world
ENV JVM_OPTS -Xmx512M -Xms512M
ENV VERSION 1.7.9

26
minecraft-server/run.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/sh
case $VERSION in
LATEST)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
;;
SNAPSHOT)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
;;
esac
cd /data
if [ ! -e minecraft_server.$VERSION.jar ]; then
wget https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
fi
if [ ! -e server.properties ]; then
cp /tmp/server.properties .
fi
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
java $JVM_OPTS -jar minecraft_server.$VERSION.jar

View file

@ -0,0 +1,33 @@
op-permission-level=4
allow-nether=true
level-name=world
enable-query=false
allow-flight=false
announce-player-achievements=true
server-port=25565
level-type=DEFAULT
enable-rcon=false
force-gamemode=false
level-seed=
server-ip=
max-build-height=256
spawn-npcs=true
white-list=false
spawn-animals=true
hardcore=false
snooper-enabled=true
texture-pack=
online-mode=true
resource-pack=
pvp=true
difficulty=1
enable-command-block=false
player-idle-timeout=0
gamemode=0
max-players=20
spawn-monsters=true
generate-structures=true
view-distance=10
spawn-protection=16
motd=Welcome Nate and Alex