LoupGarou/docker/Dockerfile
Ronan TREILLET 84251d2cdb
Fix build error sous windows (#11)
si la mémoire requise minimum n'est pas explicitée, le build échoue
2020-03-21 12:01:03 +01:00

30 lines
917 B
Docker

ARG SPIGOT_VERSION=1.15.1
# Build Loup-Garou project
FROM maven:3.3-jdk-8 as LOUP_GAROU_BUILDER
WORKDIR /app
COPY . .
RUN mvn clean install
RUN mvn package
# Build Spigot project
FROM openjdk:8 AS SPIGOT_BUILDER
ARG SPIGOT_VERSION
WORKDIR /spigot
RUN apt-get update
ADD https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar buildtools.jar
RUN git config --global --unset core.autocrlf || true
RUN java -Xmx1024M -jar buildtools.jar --rev ${SPIGOT_VERSION}
# Final server image
FROM openjdk:8
ARG SPIGOT_VERSION
WORKDIR /_minecraft
COPY --from=LOUP_GAROU_BUILDER /app/target/LoupGarou.jar ./plugins/
ADD https://github.com/dmulloy2/ProtocolLib/releases/download/4.5.0/ProtocolLib.jar ./plugins
COPY --from=SPIGOT_BUILDER /spigot/spigot-${SPIGOT_VERSION}.jar ./spigot.jar
VOLUME /minecraft
WORKDIR /minecraft
EXPOSE 25565
CMD cp -rn /_minecraft/* . && tail -f /dev/null