25 lines
608 B
Docker
25 lines
608 B
Docker
FROM alpine:latest
|
|
|
|
# Install dependencies
|
|
RUN apk update && apk add --no-cache \
|
|
bash \
|
|
rsync \
|
|
coreutils \
|
|
cronie \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
|
# Copy backup and list scripts
|
|
COPY backup.sh /usr/local/bin/backup.sh
|
|
COPY list.sh /usr/local/bin/list.sh
|
|
# Mark them executables
|
|
RUN chmod +x /usr/local/bin/backup.sh
|
|
RUN chmod +x /usr/local/bin/list.sh
|
|
|
|
# Add crontab file and needed cache directory
|
|
RUN mkdir -p /root/.cache/crontab && chmod 700 /root/.cache/crontab
|
|
COPY crontab.txt /etc/crontabs/root
|
|
RUN crontab /etc/crontabs/root
|
|
|
|
# Start cron in foreground
|
|
CMD ["/usr/sbin/crond", "-f"] |