commit 9ecadedb69a8c9b0e8f45646f20d15695dacb944 Author: Chris Date: Fri Mar 10 01:01:10 2017 +0100 initial diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..82b921d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM zombi/base +MAINTAINER Chris +EXPOSE 8123 +EXPOSE 25565 +EXPOSE 25565/udp + +ENV \ +DEPENDENCIES="openjdk-7-jre-headless git wget tar" + +RUN \ +apt-get update &&\ +apt-get -y install ${DEPENDENCIES} &&\ +apt-get clean + +WORKDIR /usr/games +VOLUME ["/usr/games/mcserv"] +RUN \ +chown -R games: . &&\ +chmod 775 mcserv + +USER games +WORKDIR /usr/games/mcserv + +ADD start.sh /opt/start.sh + +ENTRYPOINT [ "/opt/start.sh" ] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..98962d6 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +## bukkit server +bukkit server + +### Building bukkit-server + +``` +docker build -t zombi/spigot-server . +``` + +### Running bukkit-server + +``` +docker run -it -d \ + -v /data/minecraft/mc-basti-new:/usr/games/mcserv \ + --name bukkit-basti \ + -p 8123:8123/tcp \ + -p 25569:25565/udp \ + -p 25569:25565/tcp \ + zombi/spigot-server +``` + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..3f6b892 --- /dev/null +++ b/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# check if the spigot is alredy built +cd /usr/games/mcserv + +if ls /usr/games/mcserv/spigot*.jar &> /dev/null +then +spigot_filename="$(ls -1 /usr/games/mcserv/spigot*.jar)" +echo "eula=true" > /usr/games/mcserv/eula.txt +java -Xms512M -Xmx1G -XX:MaxPermSize=128M -XX:+UseConcMarkSweepGC -jar "${spigot_filename}" +else +echo "spigot not built yet. rebuilding it" +wget -O /usr/games/mcserv/BuildTools.jar "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" +java -jar BuildTools.jar +fi +