Skip to content

Commit 3b4ad04

Browse files
committed
Remove go-cron
1 parent 3794739 commit 3b4ad04

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# Download go-cron
33
ARG ALPINE_VERSION=3.21
44

5-
FROM curlimages/curl AS go-cron-downloader
6-
ARG GOCRON_VERSION=0.0.5
7-
8-
RUN curl -sL https://github.com/ivoronin/go-cron/releases/download/v${GOCRON_VERSION}/go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz -O
9-
RUN tar xvf go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz
10-
115
FROM alpine:${ALPINE_VERSION}
126

137
RUN apk update && \
@@ -19,8 +13,6 @@ RUN apk update && \
1913

2014
RUN rm -rf /var/cache/apk/*
2115

22-
COPY --from=go-cron-downloader /home/curl_user/go-cron /usr/local/bin/go-cron
23-
2416
ENV DATABASE_NAME ''
2517
ENV DATABASE_HOST ''
2618
ENV DATABASE_PORT ''

src/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ fi
1111
if [ -z "$SCHEDULE" ]; then
1212
sh backup.sh
1313
else
14-
exec go-cron "$SCHEDULE" /bin/sh backup.sh
14+
# Use crond from busybox which is available in Alpine
15+
echo "$SCHEDULE /bin/sh $(pwd)/backup.sh" > /etc/crontabs/root
16+
# Start crond in foreground mode
17+
exec crond -f -d 8
1518
fi

0 commit comments

Comments
 (0)