diff --git a/examples/paper-build-plugins/Dockerfile b/examples/paper-build-plugins/Dockerfile new file mode 100644 index 00000000..dbf11085 --- /dev/null +++ b/examples/paper-build-plugins/Dockerfile @@ -0,0 +1,5 @@ +FROM itzg/minecraft-server + +ENV TYPE=PAPER + +COPY plugins/*.jar /plugins/ \ No newline at end of file diff --git a/examples/paper-build-plugins/docker-compose.yml b/examples/paper-build-plugins/docker-compose.yml new file mode 100644 index 00000000..76e42eb7 --- /dev/null +++ b/examples/paper-build-plugins/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.7' + +services: + mc: + build: . + environment: + EULA: "TRUE" + ports: + - 25565:25565 \ No newline at end of file diff --git a/examples/paper-build-plugins/plugins/.gitignore b/examples/paper-build-plugins/plugins/.gitignore new file mode 100644 index 00000000..f23b9489 --- /dev/null +++ b/examples/paper-build-plugins/plugins/.gitignore @@ -0,0 +1 @@ +*.jar \ No newline at end of file diff --git a/examples/paper-build-plugins/plugins/README.md b/examples/paper-build-plugins/plugins/README.md new file mode 100644 index 00000000..9a94d5cd --- /dev/null +++ b/examples/paper-build-plugins/plugins/README.md @@ -0,0 +1 @@ +Download Bukkit/Spigot plugin jars, such as [WorldEdit](https://dev.bukkit.org/projects/worldedit/files) and place them here. At image build time the `COPY` step will place those jars in `/plugins`. At container startup, the contents of `/plugins` are sync'ed into `/data/plugins` for use with Bukkit/Spigot/Paper server types. \ No newline at end of file diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 6f5ab2a6..20836787 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -64,15 +64,17 @@ do fi done -mkdir -p /data/plugins -if [ "$TYPE" = "SPIGOT" ]; then - if [ -d /plugins ]; then - log "Copying any Bukkit plugins over..." - # Copy plugins over using rsync to allow deeply nested updates of plugins - # only updates files if the source file is newer and print updated files - rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data - fi -fi +case ${TYPE} in + SPIGOT|BUKKIT|PAPER) + mkdir -p /data/plugins + if [ -d /plugins ]; then + log "Copying plugins over..." + # Copy plugins over using rsync to allow deeply nested updates of plugins + # only updates files if the source file is newer and print updated files + rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data + fi + ;; +esac EXTRA_ARGS="" # Optional disable console