mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-04-05 12:48:51 +00:00
Compare commits
10 Commits
alpine
...
1.3.0-0.9.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5596197a6 | ||
|
|
4713b3f13b | ||
|
|
0c8da5f31e | ||
|
|
5a1bec484a | ||
|
|
0f6a7bd462 | ||
|
|
e81386c51a | ||
|
|
11513a9b20 | ||
|
|
9469bbe7ba | ||
|
|
15012cdab1 | ||
|
|
ec42bdd04c |
16
Dockerfile
16
Dockerfile
@@ -1,24 +1,14 @@
|
||||
FROM alpine:3.10.1 as certs
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
# Get restic executable
|
||||
ENV RESTIC_VERSION=0.9.5
|
||||
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
|
||||
|
||||
FROM alpine as rclone
|
||||
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 busybox:glibc
|
||||
FROM restic/restic:0.9.6
|
||||
|
||||
# install mailx
|
||||
RUN apk add --update --no-cache heirloom-mailx
|
||||
RUN apk add --update --no-cache heirloom-mailx fuse
|
||||
|
||||
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
|
||||
COPY --from=certs /bin/restic /bin/restic
|
||||
COPY --from=rclone /bin/rclone /bin/rclone
|
||||
|
||||
RUN \
|
||||
|
||||
@@ -87,7 +87,7 @@ The container is setup by setting [environment variables](https://docs.docker.co
|
||||
|
||||
Since restic saves the hostname with each snapshot and the hostname of a docker container is derived from it's id you might want to customize this by setting the hostname of the container to another value.
|
||||
|
||||
Either by setting the [environment variable](https://docs.docker.com/engine/reference/run/#env-environment-variables) `HOSTNAME` or with `--hostname` in the [network settings](https://docs.docker.com/engine/reference/run/#network-settings)
|
||||
Set `--hostname` in the [network settings](https://docs.docker.com/engine/reference/run/#network-settings)
|
||||
|
||||
## Backup via SFTP
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ fileExistenceTests:
|
||||
metadataTest:
|
||||
volumes: ["/data"]
|
||||
entrypoint: ["/entry.sh"]
|
||||
cmd: ["tail","-fn0", "/var/log/cron.log"]
|
||||
cmd: ["tail","-fn0", "/var/log/cron.log"]
|
||||
@@ -6,4 +6,4 @@ services:
|
||||
command: ["test", "--image", "restic-backup", "--config", "config.yml"]
|
||||
volumes:
|
||||
- ./config.yml:/config.yml
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
2
run.sh
2
run.sh
@@ -7,7 +7,7 @@ echo "Start backup-test container. Backup of ~/test-data/ to repository ~/test-r
|
||||
docker run --privileged --name backup-test \
|
||||
-e "RESTIC_PASSWORD=test" \
|
||||
-e "RESTIC_TAG=test" \
|
||||
-e "BACKUP_CRON=0 0 * * *" \
|
||||
-e "BACKUP_CRON=* * * * *" \
|
||||
-e "RESTIC_FORGET_ARGS=--keep-last 10" \
|
||||
-v ~/test-data:/data \
|
||||
-v ~/test-repo/:/mnt/restic \
|
||||
|
||||
Reference in New Issue
Block a user