From c006f572467b9927d902077812670f958a6a2c10 Mon Sep 17 00:00:00 2001 From: Julia Date: Fri, 5 Nov 2021 23:06:12 +0100 Subject: [PATCH] Add minecraft-spigot --- minecraft-spigot/Dockerfile | 25 +++++++++++++++++++++++++ minecraft-spigot/build.sh | 1 + 2 files changed, 26 insertions(+) create mode 100644 minecraft-spigot/Dockerfile create mode 100755 minecraft-spigot/build.sh diff --git a/minecraft-spigot/Dockerfile b/minecraft-spigot/Dockerfile new file mode 100644 index 0000000..2eb7a4e --- /dev/null +++ b/minecraft-spigot/Dockerfile @@ -0,0 +1,25 @@ +FROM alpine:edge AS buildtools + +ARG VERSION + +RUN apk add git openjdk17 curl +RUN adduser -D buildtools + +USER buildtools +WORKDIR /home/buildtools +RUN curl -o buildtools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar + +RUN java -jar buildtools.jar --rev $VERSION +RUN mv ./spigot-$VERSION.jar ./spigot.jar + +FROM openjdk:latest AS minecraft-paper + +RUN mkdir /usr/games/minecraft-spigot /usr/games/minecraft-spigot/data +RUN chown -R games /usr/games + +USER games +WORKDIR /usr/games/minecraft-spigot +COPY --chown=games:users --from=buildtools /home/buildtools/spigot.jar ./spigot.jar + +WORKDIR /usr/games/minecraft-spigot/data +CMD [ "java", "-jar", "../spigot.jar" ] diff --git a/minecraft-spigot/build.sh b/minecraft-spigot/build.sh new file mode 100755 index 0000000..b30843f --- /dev/null +++ b/minecraft-spigot/build.sh @@ -0,0 +1 @@ +docker build --no-cache -t minecraft-spigot:$1 --build-arg VERSION=$1 .