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"
|
|
|
|
ARG FORGE_VERSION="36.1.4"
|
|
|
|
|
|
|
|
# The actual setup work
|
|
|
|
COPY start-server.sh /minecraft/start-server.sh
|
|
|
|
WORKDIR /minecraft
|
|
|
|
RUN apk add curl openjdk8-jre &&\
|
|
|
|
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
|
|
|
|
|
|
|
|
# The second stage is the actual container
|
|
|
|
FROM openjdk:8
|
2021-04-09 16:54:45 -05:00
|
|
|
RUN apt-get update && apt-get install rsync -y
|
2021-04-09 16:28:17 -05:00
|
|
|
WORKDIR /minecraft
|
|
|
|
COPY --from=build /minecraft .
|
|
|
|
CMD [ "bash", "start-server.sh" ]
|
|
|
|
EXPOSE 25565
|