From bfc498b9ff62c87841234debb38c6e78986f007d Mon Sep 17 00:00:00 2001 From: x1a0 Date: Sun, 17 May 2026 12:51:39 +0200 Subject: [PATCH] Replace alpine crond with supercronic alpine crond requires root; supercronic works as any user. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 572c07b..358b109 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ FROM alpine:3.19 # zstd for compression, tzdata so cron fires at correct local time -RUN apk add --no-cache zstd tzdata +RUN apk add --no-cache zstd tzdata curl COPY compress.sh /usr/local/bin/compress.sh RUN chmod +x /usr/local/bin/compress.sh -# Install crontab: run compress at 02:00 every night -RUN echo "0 2 * * * /usr/local/bin/compress.sh > /proc/1/fd/1 2>&1" \ - | crontab - +# supercronic runs as any user (unlike alpine crond which requires root) +RUN ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') && \ + curl -fsSL "https://github.com/aptible/supercronic/releases/latest/download/supercronic-linux-${ARCH}" \ + -o /usr/local/bin/supercronic && chmod +x /usr/local/bin/supercronic -# crond -f: foreground (required for containers) -# crond -l 2: log level warning and above -CMD ["crond", "-f", "-l", "2"] +RUN echo "0 2 * * * /usr/local/bin/compress.sh > /proc/1/fd/1 2>&1" > /etc/crontab + +CMD ["supercronic", "/etc/crontab"]