minecraft/Dockerfile

39 lines
940 B
Docker

FROM alpine:3.13 as builder
RUN apk --no-cache add \
openjdk8 \
git \
maven
ENV BUILDTOOLS_VERSION=abd1c566d8cd758bac3a9d67543b719d4b9ab673
RUN git clone https://hub.spigotmc.org/stash/scm/spigot/buildtools.git
WORKDIR /buildtools
RUN git checkout "$BUILDTOOLS_VERSION"
RUN mvn package
ENV SPIGOT_VERSION=1.16.5
RUN java -jar target/BuildTools.jar --rev "$SPIGOT_VERSION"
RUN mv spigot-$SPIGOT_VERSION.jar spigot.jar
FROM thallian/confd-env:latest
COPY --from=builder /buildtools/spigot.jar /var/lib/minecraft/spigot.jar
RUN apk add --no-cache \
openjdk8 \
openssl
RUN addgroup minecraft -g 2222
RUN adduser -u 2222 -h /var/lib/minecraft -D -G minecraft minecraft
RUN mkdir -p /etc/services.d/minecraft/
ADD /rootfs /
RUN chown -R minecraft:minecraft /var/lib/minecraft
VOLUME /var/lib/minecraft/world /var/lib/minecraft/world_nether /var/lib/minecraft/world_the_end /var/lib/minecraft/plugins
EXPOSE 25565