2021-04-09 16:28:17 -05:00
|
|
|
# The first stage just builds up the modpack
|
|
|
|
FROM alpine:latest AS build
|
|
|
|
|
|
|
|
# Args
|
|
|
|
ARG MINECRAFT_VERSION="1.16.5"
|
2022-02-09 15:57:14 -06:00
|
|
|
ARG FORGE_VERSION="36.2.26"
|
2022-05-17 10:53:13 -05:00
|
|
|
ARG JRE_VERSION="openjdk8-jre"
|
2021-04-09 16:28:17 -05:00
|
|
|
|
2022-05-17 11:07:10 -05:00
|
|
|
# Build us up the basics of the Minecraft server environment
|
2021-04-09 16:28:17 -05:00
|
|
|
COPY start-server.sh /minecraft/start-server.sh
|
|
|
|
WORKDIR /minecraft
|
2022-05-17 11:22:36 -05:00
|
|
|
RUN apk add curl &&\
|
|
|
|
apk add "${JRE_VERSION}" &&\
|
2021-04-09 16:28:17 -05:00
|
|
|
curl -L "https://files.minecraftforge.net/maven/net/minecraftforge/forge/${MINECRAFT_VERSION}-${FORGE_VERSION}/forge-${MINECRAFT_VERSION}-${FORGE_VERSION}-installer.jar" -o installer.jar &&\
|
|
|
|
java -jar installer.jar --installServer &&\
|
|
|
|
echo "eula=true" > eula.txt &&\
|
|
|
|
rm installer.jar installer.jar.log && \
|
|
|
|
ln -s "forge-${MINECRAFT_VERSION}-${FORGE_VERSION}.jar" server.jar
|
|
|
|
|
2022-05-17 11:07:10 -05:00
|
|
|
# Stuff them in a smaller container with fewer layers
|
|
|
|
FROM alpine:latest
|
2022-05-17 11:22:36 -05:00
|
|
|
RUN apk add bash rsync screen &&\
|
|
|
|
apk add "${JRE_VERSION}"
|
2021-04-09 16:28:17 -05:00
|
|
|
WORKDIR /minecraft
|
|
|
|
COPY --from=build /minecraft .
|
|
|
|
CMD [ "bash", "start-server.sh" ]
|
|
|
|
EXPOSE 25565
|