forked from lojutaan/restic-backup-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (46 loc) · 1.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM alpine:latest 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:0.12.0
RUN apk add --update --no-cache heirloom-mailx fuse curl
COPY --from=rclone /bin/rclone /bin/rclone
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_INIT_ARGS=""
ENV RESTIC_FORGET_ARGS=""
ENV RESTIC_JOB_ARGS=""
ENV MAILX_ARGS=""
ENV OS_AUTH_URL=""
ENV OS_PROJECT_ID=""
ENV OS_PROJECT_NAME=""
ENV OS_USER_DOMAIN_NAME="Default"
ENV OS_PROJECT_DOMAIN_ID="default"
ENV OS_USERNAME=""
ENV OS_PASSWORD=""
ENV OS_REGION_NAME=""
ENV OS_INTERFACE=""
ENV OS_IDENTITY_API_VERSION=3
# openshift fix
RUN mkdir /.cache && \
chgrp -R 0 /.cache && \
chmod -R g=u /.cache && \
chgrp -R 0 /mnt && \
chmod -R g=u /mnt && \
chgrp -R 0 /var/spool/cron/crontabs/root && \
chmod -R g=u /var/spool/cron/crontabs/root && \
chgrp -R 0 /var/log/cron.log && \
chmod -R g=u /var/log/cron.log
# /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"]