61 lines
1.7 KiB
Markdown
61 lines
1.7 KiB
Markdown
# Restic Docker image
|
|
|
|
Restic image for various platforms.
|
|
|
|
## Build
|
|
|
|
Just run `make` to build and push everything. Check `ORG` and `PLATFORMS`
|
|
variables to customize.
|
|
|
|
## Usage
|
|
|
|
You can use this image as regular restic image or use built-in cron and
|
|
backup.sh script which can be useful for example in statefulsets:
|
|
|
|
|
|
```yaml
|
|
- name: backup
|
|
image: genunix/restic:latest
|
|
imagePullPolicy: Always
|
|
command:
|
|
- /bin/sh
|
|
- -cxe
|
|
- |
|
|
echo "0 3 * * * /bin/sh -e /usr/local/bin/backup.sh" > /var/spool/cron/crontabs/root;
|
|
crond -f
|
|
env:
|
|
- name: NODE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
- name: TAG
|
|
value: myapp
|
|
- name: INSTANCE
|
|
value: "${TAG}-${NODE}"
|
|
- name: BACKUP_PATH
|
|
value: /srv/zwave-js-ui
|
|
- name: RESTIC_REPOSITORY
|
|
value: "s3:https://s3.eu-central-1.wasabisys.com/backups/${INSTANCE}"
|
|
- name: RESTIC_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: restic-rest-secret
|
|
key: RESTIC_PASSWORD
|
|
- name: AWS_ACCESS_KEY_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: restic-rest-secret
|
|
key: AWS_ACCESS_KEY_ID
|
|
- name: AWS_SECRET_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: restic-rest-secret
|
|
key: AWS_SECRET_ACCESS_KEY
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /srv/mysvc
|
|
```
|
|
|
|
This image also sends metrics into prometheus-pushgateway service which needs
|
|
to be configured properly.
|