10 Commits

Author SHA1 Message Date
Tobias Kaupat
d5596197a6 Install fuse to allow "restic mount" 2020-05-18 17:49:41 +02:00
Tobias Kaupat
4713b3f13b Rename docker-compose.test.yml to docker-compose.test.broken.yml 2020-01-07 18:21:06 +01:00
Tobias Kaupat
0c8da5f31e Update and rename config.yml to config-broken.yml 2020-01-07 16:45:19 +01:00
Tobias Kaupat
5a1bec484a Update config.yml
disable tests
2020-01-07 16:41:15 +01:00
Tobias Kaupat
0f6a7bd462 Update README.md
Update how to set hostname
2020-01-07 16:30:14 +01:00
Victor Fauth
e81386c51a Use static restic version in Dockerfile 2019-11-29 00:51:09 +01:00
Max Stabel
11513a9b20 Copy rclone to final image 2019-11-29 00:51:09 +01:00
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
Max Stabel
15012cdab1 Run test backup every minute
Change interval of cron to backup every minute instead of once a day at
midnight to make it in line with the documentation.
2019-10-11 10:53:37 +02:00
Tobias Kaupat
ec42bdd04c Merge pull request #38 from lobaro/alpine
Merge Alpine to master for #4
2019-09-19 10:30:06 +02:00
5 changed files with 7 additions and 17 deletions

View File

@@ -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 \

View File

@@ -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

View File

@@ -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"]

View File

@@ -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
View File

@@ -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 \