2020-08-12 17:16:07 +02:00
|
|
|
FROM openjdk:8-jre
|
2020-08-12 16:50:47 +02:00
|
|
|
EXPOSE 25565
|
|
|
|
|
|
|
|
ARG MINECRAFT=1.7.10
|
|
|
|
ARG FORGE=10.13.4.1641
|
|
|
|
|
|
|
|
ENV \
|
|
|
|
ForgeUrl1=http://files.minecraftforge.net/maven/net/minecraftforge/forge/${MINECRAFT}-${FORGE}/forge-${MINECRAFT}-${FORGE}-installer.jar \
|
|
|
|
ForgeUrl2=http://files.minecraftforge.net/maven/net/minecraftforge/forge/${MINECRAFT}-${FORGE}-${MINECRAFT}/forge-${MINECRAFT}-${FORGE}-${MINECRAFT}-installer.jar \
|
2020-11-14 01:28:30 +01:00
|
|
|
InstallerJar=forge-${MINECRAFT}-${FORGE}-installer.jar \
|
|
|
|
MINECRAFT=$MINECRAFT \
|
|
|
|
FORGE=$FORGE
|
2020-08-12 16:50:47 +02:00
|
|
|
|
|
|
|
ENV \
|
|
|
|
INSTDIR=/usr/share/minecraft \
|
|
|
|
RUNDIR=/minecraft
|
|
|
|
|
|
|
|
RUN useradd -U -d /minecraft -m forge
|
|
|
|
|
|
|
|
WORKDIR $INSTDIR
|
|
|
|
|
|
|
|
# Since the URL schema changed, we need to try both after another.
|
|
|
|
# Prepare the server files and remove the installer.
|
|
|
|
# The EULA needs to be present, so we also accept it at this point.
|
|
|
|
# The remaining jar beginning with forge-* is the launcher (multiple names
|
|
|
|
# possible), so we will symlink it to forge.jar for convenience.
|
|
|
|
RUN ( wget -O ${InstallerJar} ${ForgeUrl1} || wget -O ${InstallerJar} ${ForgeUrl2} ) && \
|
|
|
|
echo "eula=true" > eula.txt && \
|
|
|
|
java -jar ./${InstallerJar} --installServer && rm -f ${InstallerJar} && \
|
2020-11-14 02:05:23 +01:00
|
|
|
ln -s "forge-*.jar" forge.jar || exit 2
|
2020-08-12 16:50:47 +02:00
|
|
|
|
|
|
|
COPY entrypoint.sh /usr/bin
|
|
|
|
|
|
|
|
WORKDIR $RUNDIR
|
|
|
|
|
|
|
|
VOLUME ["/minecraft"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
|
|
|
|