Added papermc; updated fabric files

This commit is contained in:
Jef Roosens 2020-12-30 12:53:37 +01:00
parent 988420f915
commit a6e5d39811
4 changed files with 90 additions and 17 deletions

View file

@ -1,30 +1,31 @@
FROM openjdk:8-jre
FROM openjdk:8-slim
# This argument should be set when building
ARG VERSION
ARG JAR_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$VERSION/fabric-installer-$VERSION.jar"
# Build arguments
ARG FABRIC_VERSION
# Create worlds and config directory
WORKDIR /mc
RUN mkdir worlds config
# Download installer jar
ADD "https://maven.fabricmc.net/net/fabricmc/fabric-installer/$VERSION/fabric-installer-$VERSION.jar" fabric-installer.jar
ADD "https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar" fabric-installer.jar
# Install fabric, sign eula & remove installer
RUN java -jar fabric-installer.jar server -downloadMinecraft && \
rm fabric-installer.jar && \
echo "eula=true" > eula.txt
rm fabric-installer.jar
# Store the cache in an anonymous volume, which means it won't get stored in the other volumes
VOLUME /mc/config/cache
WORKDIR /mc/config
# Default value to keep users from eating up all ram accidentally
ENV XMS=4
WORKDIR /mc/config
# Source for flags:
# https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
# Certain flags auto-scale if XMS is greater than 12 (see link for info)
ENTRYPOINT mv -n /mc/*.jar /mc/config && java \
# We copy over the server jar(s) as well to make the backup more reproducible to deploy
ENTRYPOINT mv -n /mc/*.jar /mc/config && \
echo "eula=true" > /mc/config/eula.txt && \
java \
-Xms"${XMS}G" \
-Xmx"${XMX:-$XMS}G" \
-XX:+UseG1GC \
@ -50,4 +51,3 @@ ENTRYPOINT mv -n /mc/*.jar /mc/config && java \
-jar fabric-server-launch.jar \
--universe /mc/worlds \
--nogui