From a3169725e92ec3bfcdb90d21d25fe1c71f4315a8 Mon Sep 17 00:00:00 2001 From: Commandcracker <49335821+Commandcracker@users.noreply.github.com> Date: Thu, 24 Apr 2025 14:31:58 +0200 Subject: [PATCH] Use none root user inside docker container (#680) * Never use root :D * Change to 2613 --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c7b5551b..613f23b1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,6 @@ RUN --mount=type=cache,sharing=private,target=/pumpkin/target \ FROM alpine:3.21 -RUN apk add --no-cache libgcc - COPY --from=builder /pumpkin/pumpkin.release /bin/pumpkin # set workdir to /pumpkin, this is required to influence the PWD environment variable @@ -26,7 +24,10 @@ COPY --from=builder /pumpkin/pumpkin.release /bin/pumpkin # executable (without requiring an `docker cp`-ing the binary to the host folder) WORKDIR /pumpkin +RUN apk add --no-cache libgcc && chown 2613:2613 . + ENV RUST_BACKTRACE=1 EXPOSE 25565 +USER 2613:2613 ENTRYPOINT [ "/bin/pumpkin" ] HEALTHCHECK CMD nc -z 127.0.0.1 25565 || exit 1