commit 1841433d014f40fec2a4434d2c112e21c186a334 Author: Sebastian Hugentobler Date: Wed Jul 20 16:56:47 2016 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..af0faab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +.DS_Store +*.swp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d918eb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM thallian/confd-env:latest + +RUN apk add --no-cache openjdk8 git openssl bash + +RUN addgroup minecraft +RUN adduser -h /var/lib/minecraft -D -G minecraft minecraft + +RUN mkdir /tmp/minecraft/ +RUN wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" -O /tmp/minecraft/BuildTools.jar +RUN cd /tmp/minecraft && bash -c 'java -jar BuildTools.jar' + +RUN cp /tmp/minecraft/spigot*.jar /var/lib/minecraft/spigot.jar +RUN cp /tmp/minecraft/craftbukkit*.jar /var/lib/minecraft/craftbukkit.jar + +RUN rm -r /tmp/minecraft +RUN apk del git bash + +ADD /rootfs / + +RUN chown -R minecraft:minecraft /var/lib/minecraft + +VOLUME /var/lib/minecraft/world /var/lib/minecraft/world_nether /var/lib/minecraft/world_the_end /var/lib/minecraft/plugins + +EXPOSE 25565 \ No newline at end of file diff --git a/rootfs/etc/confd/conf.d/server.properties.toml b/rootfs/etc/confd/conf.d/server.properties.toml new file mode 100644 index 0000000..c9e80a5 --- /dev/null +++ b/rootfs/etc/confd/conf.d/server.properties.toml @@ -0,0 +1,6 @@ +[template] +src = "server.properties.tmpl" +dest = "/var/lib/minecraft/server.properties" +gid = 1000 +uid = 1000 +mode = "0660" diff --git a/rootfs/etc/confd/templates/server.properties.tmpl b/rootfs/etc/confd/templates/server.properties.tmpl new file mode 100644 index 0000000..2de70f9 --- /dev/null +++ b/rootfs/etc/confd/templates/server.properties.tmpl @@ -0,0 +1,33 @@ +generator-settings= +use-native-transport=true +op-permission-level={{getenv "OP_PERMISSION_LEVEL"}} +allow-nether={{getenv "ALLOW_NETHER"}} +level-name={{getenv "LEVEL_NAME"}} +allow-flight={{getenv "ALLOW_FLIGHT"}} +announce-player-achievements={{getenv "ANNOUNCE_PLAYER_ACHIEVEMENTS"}} +server-port=25565 +max-world-size={{getenv "MAX_WORLDSIZE"}} +level-type={{getenv "LEVEL_TYPE"}} +level-seed={{getenv "LEVEL_SEED"}} +force-gamemode=false +server-ip= +network-compression-threshold=256 +max-build-height={{getenv "MAX_BUILD_HEIGHT"}} +spawn-npcs={{getenv "SPAWN_NPCS"}} +white-list={{getenv "WHITELIST"}} +spawn-animals={{getenv "SPAWN_ANIMALS"}} +hardcore={{getenv "HARDCORE"}} +snooper-enabled=true +resource-pack-sha1= +online-mode={{getenv "ONLINE_MODE"}} +resource-pack= +pvp={{getenv "PVP"}} +difficulty={{getenv "DIFFICULTY"}} +enable-command-block=false +gamemode={{getenv "GAMEMODE"}} +player-idle-timeout={{getenv "PLAYER_IDLE_TIMEOUT"}} +max-players={{getenv "MAX_PLAYERS"}} +spawn-monsters={{getenv "SPAWN_MONSTERS"}} +generate-structures={{getenv "GENERATE_STRUCTURES"}} +view-distance={{getenv "VIEW_DISTANCE"}} +motd={{getenv "MOTD"}} \ No newline at end of file diff --git a/rootfs/etc/fix-attrs.d/01-minecraft b/rootfs/etc/fix-attrs.d/01-minecraft new file mode 100644 index 0000000..e0d369b --- /dev/null +++ b/rootfs/etc/fix-attrs.d/01-minecraft @@ -0,0 +1 @@ +/var/lib/minecraft/ true minecraft 0640 0750 diff --git a/rootfs/etc/services.d/minecraft/run b/rootfs/etc/services.d/minecraft/run new file mode 100644 index 0000000..7ed2ee6 --- /dev/null +++ b/rootfs/etc/services.d/minecraft/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv sh + +cd /var/lib/minecraft +exec s6-setuidgid minecraft java -jar /var/lib/minecraft/spigot.jar diff --git a/rootfs/var/lib/minecraft/eula.txt b/rootfs/var/lib/minecraft/eula.txt new file mode 100644 index 0000000..ac74b96 --- /dev/null +++ b/rootfs/var/lib/minecraft/eula.txt @@ -0,0 +1 @@ +eula=true \ No newline at end of file