Files
restic-backup-docker/Dockerfile
Max Stabel 9469bbe7ba Base image directly on official restic image
This has the advantage of using Alpine Linux as base and having certs,
ssh and fuse already installed.
2019-11-29 00:51:09 +01:00

36 lines
816 B
Docker

FROM alpine as rclone
# Get rclone executable
ADD https://downloads.rclone.org/rclone-current-linux-amd64.zip /
RUN unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/rclone && chmod +x /bin/rclone
FROM restic/restic:latest
# install mailx
RUN apk add --update --no-cache heirloom-mailx
RUN \
mkdir -p /mnt/restic /var/spool/cron/crontabs /var/log; \
touch /var/log/cron.log;
ENV RESTIC_REPOSITORY=/mnt/restic
ENV RESTIC_PASSWORD=""
ENV RESTIC_TAG=""
ENV NFS_TARGET=""
ENV BACKUP_CRON="0 */6 * * *"
ENV RESTIC_FORGET_ARGS=""
ENV RESTIC_JOB_ARGS=""
ENV MAILX_ARGS=""
# /data is the dir where you have to put the data to be backed up
VOLUME /data
COPY backup.sh /bin/backup
COPY entry.sh /entry.sh
WORKDIR "/"
ENTRYPOINT ["/entry.sh"]
CMD ["tail","-fn0","/var/log/cron.log"]