paper: updated to 1.19.2 & added dumb-init to image

This commit is contained in:
Jef Roosens 2022-09-25 17:52:28 +02:00
parent 23f7911271
commit a904ef47d0
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
2 changed files with 24 additions and 8 deletions

View file

@ -1,8 +1,23 @@
ARG BASE_IMAGE
# Build dumb-init
FROM alpine AS dumb-init-builder
ARG DI_VER=1.2.5
WORKDIR /app
# Build dumb-init & download tshock
RUN apk add --update --no-cache build-base unzip curl && \
curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.tar.gz" | tar -xzf - && \
cd "dumb-init-${DI_VER}" && \
make SHELL=/bin/sh && \
mv dumb-init ..
# We use ${:-} instead of a default value because the argument is always passed
# to the build, it'll just be blank most likely
FROM ${BASE_IMAGE:-'openjdk:17-slim'}
FROM ${BASE_IMAGE:-'openjdk:18-slim'}
# Build arguments
ARG MC_VERSION
@ -42,9 +57,12 @@ EXPOSE 25565
USER paper:paper
# Entrypoint runs in /app/config
COPY --from=dumb-init-builder /app/dumb-init /dumb-init
COPY entrypoint.sh /entrypoint.sh
WORKDIR /app/config
ENTRYPOINT /entrypoint.sh
ENTRYPOINT ["/dumb-init", "--"]
CMD /entrypoint.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=1m --retries=5 \
CMD mcstatus localhost:25565 ping