Minecraft configuration/build files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
768 B

FROM openjdk:12-jdk-alpine as builder
# Run in /tmp
RUN apk add --no-cache --update curl git
RUN curl -sS https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar > BuildTools.jar
# Build executable
RUN java -Xmx2048M -jar BuildTools.jar --rev latest
# Preparing runtime container with slimmed-down version of openjdk
FROM openjdk:12-alpine
EXPOSE 25565
VOLUME /worlds
WORKDIR /minecraft
RUN chown nobody:nogroup /minecraft
USER nobody:nogroup
CMD ["-Xmx2048M", "-Xms1024M", "-Dfile.encoding=UTF-8", "-Dcom.mojang.eula.agree=true", "-jar", "/minecraft/server.jar", "--world-dir", "/worlds"]
# Copy built executable
COPY --chown=nobody:nogroup --from=builder /tmp/spigot-*.jar server.jar