Initial commit
The files were ported over from the old repository at https://git.zom.bi/zombi-systems/dockerfiles/-/tree/master/games/forge-modbase originally written by LOD, steffen and madmaurice.
This commit is contained in:
commit
0d7e5e2e52
2 changed files with 62 additions and 0 deletions
37
Dockerfile
Normal file
37
Dockerfile
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
FROM openjdk:8-jre-slim
|
||||||
|
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 \
|
||||||
|
InstallerJar=forge-${MINECRAFT}-${FORGE}-installer.jar
|
||||||
|
|
||||||
|
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} && \
|
||||||
|
ln -s "forge-${MINECRAFT}-*.jar" forge.jar || exit 2
|
||||||
|
|
||||||
|
COPY entrypoint.sh /usr/bin
|
||||||
|
|
||||||
|
WORKDIR $RUNDIR
|
||||||
|
|
||||||
|
VOLUME ["/minecraft"]
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
||||||
|
|
25
entrypoint.sh
Normal file
25
entrypoint.sh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# rmln links dest to target, but removes the target if it already exists.
|
||||||
|
rmln() {
|
||||||
|
dest=$1
|
||||||
|
target=$2
|
||||||
|
|
||||||
|
[ -e "$target" ] && rm -rf "$target"
|
||||||
|
ln -s "$dest" "$target"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rmln "$INSTDIR/forge.jar" "$RUNDIR/forge.jar"
|
||||||
|
rmln "$INSTDIR/libraries" "$RUNDIR/libraries"
|
||||||
|
rmln "$INSTDIR/minecraft_server.$MineVers.jar" "$RUNDIR/minecraft_server.$MineVers.jar"
|
||||||
|
rmln "$INSTDIR/eula.txt" "$RUNDIR/eula.txt"
|
||||||
|
|
||||||
|
( echo "MINECRAFT=${MINECRAFT}"; echo "FORGE=${FORGE}" ) > $RUNDIR/version.info
|
||||||
|
|
||||||
|
chown forge:forge "$RUNDIR"
|
||||||
|
|
||||||
|
cd $RUNDIR
|
||||||
|
|
||||||
|
exec su forge -c "/usr/bin/java -jar $RUNDIR/forge.jar"
|
||||||
|
|
Loading…
Reference in a new issue