All checks were successful
ci/woodpecker/push/build/2 Pipeline was successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/build/3 Pipeline was successful
ci/woodpecker/manual/build/1 Pipeline was successful
ci/woodpecker/manual/build/2 Pipeline was successful
ci/woodpecker/manual/build/3 Pipeline was successful
76 lines
2.8 KiB
Docker
Executable file
76 lines
2.8 KiB
Docker
Executable file
########################################################
|
|
############## We use a java base image ################
|
|
########################################################
|
|
FROM debian:sid AS build
|
|
RUN ls -lah /etc/apt/sources.list.d/
|
|
RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources
|
|
RUN apt update && apt install -y curl jq bash openjdk-21-jdk openjdk-21-jre
|
|
|
|
LABEL Marc Tönsing <marc@marc.tv>
|
|
|
|
ARG version=1.20.6
|
|
|
|
########################################################
|
|
############## Download Paper with API #################
|
|
########################################################
|
|
WORKDIR /opt/minecraft
|
|
COPY ./getpaperserver.sh /
|
|
RUN chmod +x /getpaperserver.sh
|
|
|
|
RUN ls -lah /
|
|
RUN /getpaperserver.sh ${version}
|
|
|
|
# Run paperclip and obtain patched jar
|
|
RUN java -Dpaperclip.patchonly=true -jar /opt/minecraft/paperclip.jar; exit 0
|
|
|
|
########################################################
|
|
############## Running environment #####################
|
|
########################################################
|
|
FROM debian:sid AS runtime
|
|
RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources
|
|
RUN apt update && apt install -y curl jq bash openjdk-21-jre openjdk-21-jdk sudo
|
|
|
|
# Working directory
|
|
WORKDIR /data
|
|
|
|
# Obtain runable jar from build stage
|
|
COPY --from=build /opt/minecraft/paperclip.jar /opt/minecraft/paperspigot.jar
|
|
|
|
# Install and run rcon
|
|
ARG RCON_CLI_VER=1.6.1
|
|
ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_amd64.tar.gz /tmp/rcon-cli.tgz
|
|
RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \
|
|
rm /tmp/rcon-cli.tgz
|
|
|
|
# Volumes for the external data (Server, World, Config...)
|
|
VOLUME "/data"
|
|
|
|
# Expose minecraft port
|
|
EXPOSE 25565/tcp
|
|
EXPOSE 25565/udp
|
|
|
|
# Set memory size
|
|
ARG memory_size=3G
|
|
ENV MEMORYSIZE=$memory_size
|
|
|
|
# Set Java Flags
|
|
ARG java_flags="-Dlog4j2.formatMsgNoLookups=true -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=mcflags.emc.gs -Dcom.mojang.eula.agree=true"
|
|
ENV JAVAFLAGS=$java_flags
|
|
|
|
WORKDIR /data
|
|
|
|
COPY /docker-entrypoint.sh /opt/minecraft
|
|
RUN chmod +x /opt/minecraft/docker-entrypoint.sh
|
|
|
|
RUN addgroup --gid 9001 dockergroup
|
|
RUN adduser --shell /bin/sh --uid 9001 --gid 9001 dockeruser
|
|
|
|
|
|
# Install gosu
|
|
#RUN set -eux; \
|
|
# apk update; \
|
|
# apk add --no-cache su-exec;
|
|
|
|
# Entrypoint
|
|
ENTRYPOINT ["/opt/minecraft/docker-entrypoint.sh"]
|
|
|