Dockerfiles/minecraft-spigot/Dockerfile
Julia Logan 2258eff318
Replace openjdk with eclipse-temurin
"This image is officially deprecated and all users are recommended to find and use suitable replacements ASAP."
2024-06-22 16:29:38 +02:00

25 lines
753 B
Docker

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 eclipse-temurin: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", "-Dcom.mojang.eula.agree=true", "-jar", "../spigot.jar" ]