diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index f3d6e3ae..d4797cd6 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -45,19 +45,32 @@ ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNE RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \ rm /tmp/mc-server-runner.tgz +ADD https://git.faldoria.de/tof/server/build-tools/-/jobs/artifacts/master/raw/target/ToF-BuildTools.jar?job=deploy /tmp/tof-buildtools/BuildTools.jar + +ONBUILD ARG BUILDTOOLS_OUTPUT=/plugins +ONBUILD COPY Dockerfile *plugins.yml /tmp/tof-buildtools/ +ONBUILD RUN java -jar /tmp/tof-buildtools/BuildTools.jar \ + --config "/tmp/tof-buildtools/plugins.yml" \ + --configs "plugins.yml" \ + --dir "/tmp/tof-buildtools/" \ + --output ${BUILDTOOLS_OUTPUT} && \ + chown -R minecraft:minecraft ${BUILDTOOLS_OUTPUT} && \ + rm -fR /tmp/tof-buildtools/ + COPY mcadmin.jq /usr/share RUN chmod +x /usr/local/bin/* -VOLUME ["/data","/mods","/config","/plugins"] +VOLUME ["/data","/mods","/config"] COPY server.properties /tmp/server.properties WORKDIR /data ENTRYPOINT [ "/start" ] ENV UID=1000 GID=1000 \ - JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ - TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \ - PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ - LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true + JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ + TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \ + PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ + LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true COPY start* / +RUN dos2unix /start* && chmod +x /start* diff --git a/minecraft-server/README.md b/minecraft-server/README.md index aba1cec3..183d8e06 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -263,6 +263,15 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. +### Building an image with plugins + +You can also create your own Docker images by extending the `itzg/minecraft-server` image. +The image contains an `ONBUILD` trigger that will copy a `plugins.yml` file from you build directory and download any plugins specified in it. + +You can read about the [`ToF-BuildTools` and how to use them here](https://git.faldoria.de/tof/server/build-tools). + +You can also find [an example](examples/ToF-build/) with a custom image in the examples dir. + ## Running a PaperSpigot server Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line. diff --git a/minecraft-server/examples/ToF-build/Dockerfile b/minecraft-server/examples/ToF-build/Dockerfile new file mode 100644 index 00000000..efb98d3a --- /dev/null +++ b/minecraft-server/examples/ToF-build/Dockerfile @@ -0,0 +1,3 @@ +FROM itzg/minecraft-server + +ENV TYPE=SPIGOT \ No newline at end of file diff --git a/minecraft-server/examples/ToF-build/plugins.yml b/minecraft-server/examples/ToF-build/plugins.yml new file mode 100644 index 00000000..0968449d --- /dev/null +++ b/minecraft-server/examples/ToF-build/plugins.yml @@ -0,0 +1,13 @@ +plugins: + worldedit: + file: WorldEdit.jar + url: https://dev.bukkit.org/projects/worldedit/files/latest + FastAsyncWorldEdit: + file: FastAsyncWorldEdit.jar + url: https://empcraft.com/fawe/latest.php?bukkit + worldguard: + file: WorldGuard.jar + url: https://dev.bukkit.org/projects/worldguard/files/latest + citizens: + file: Citizens.jar + url: https://dev.bukkit.org/projects/citizens/files/latest \ No newline at end of file