2019-06-06 06:37:26 +00:00
|
|
|
FROM alpine:latest as alpine
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
ca-certificates \
|
|
|
|
tzdata
|
|
|
|
|
|
|
|
FROM busybox:glibc
|
|
|
|
|
|
|
|
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
COPY --from=alpine /usr/share/zoneinfo /usr/share/zoneinfo
|
|
|
|
|
|
|
|
# Get restic executable
|
2023-03-27 05:39:24 +00:00
|
|
|
ENV RESTIC_VERSION=0.15.1
|
2019-06-06 06:37:26 +00:00
|
|
|
ADD https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_amd64.bz2 /
|
|
|
|
RUN bzip2 -d restic_${RESTIC_VERSION}_linux_amd64.bz2 && mv restic_${RESTIC_VERSION}_linux_amd64 /bin/restic && chmod +x /bin/restic
|
|
|
|
|
|
|
|
RUN mkdir -p /mnt/restic /var/spool/cron/crontabs /var/log
|
|
|
|
|
|
|
|
# /data is the dir where you have to put the data to be backed up
|
|
|
|
VOLUME /data
|
|
|
|
|
|
|
|
COPY backup.sh /bin/backup
|
|
|
|
COPY check.sh /bin/check
|
|
|
|
COPY entry.sh /entry.sh
|
|
|
|
|
|
|
|
RUN touch /var/log/cron.log
|
|
|
|
|
|
|
|
WORKDIR "/"
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entry.sh"]
|
|
|
|
|