File size: 620 Bytes
696625e 216782f d8af812 696625e d8af812 d1c3afd ad1434f d1c3afd 745e985 ad1434f 696625e d1c3afd ece9c0f 77474d5 d1c3afd 745e985 03a904d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
FROM openjdk:21
WORKDIR /minecraft
# Copy the Minecraft server JAR
COPY server.jar /minecraft
# Exposing the Minecraft server port
EXPOSE 7860
# Setting the JVM options
ENV JAVA_OPTS="-Xmx1024M -Xms1024M"
# Automatically agree to the EULA. Note: Make sure you have
# actually read and agree to the EULA at https://account.mojang.com/documents/minecraft_eula
RUN echo "eula=true" > /minecraft/eula.txt
# Create a user as running as root is not advisable
RUN useradd -m -d /minecraft -s /bin/false minecraft && chown -R minecraft:minecraft /minecraft
USER minecraft
CMD java ${JAVA_OPTS} -jar server.jar --port 7860 |