Restic backup client, with supercronic to schedule routine backups.
cd docker-tools/k8s
make secrets/restic-b2-apikey.yml
make secrets/restic-b2-apikey
make secrets/restic-repo-password.yml
make secrets/restic-repo-password
This image comes with a helm chart with template to generate the cron jobs needed to manage restic backups stored on a local machine running the rest-server image, or on cloud storage buckets offered by Backblaze B2, Amazon S3 (or compatible, such as GarageFS or Minio). Attach the volumes you want backed up -- via values overrides of the helm chart -- and define the paths to be backed up to each bucket with specifications like this:
repos:
# example -- all fields optional (defaulted under cron) except src
home:
dests: [ "$REPO_B2_HOME:", "$REPO_LOCAL/" ]
key: home
retain: --keep-hourly=3
src: /b/home
hours: 1,9,17
weekdays: 2,6
misc:
src: /b/samba_dos /b/ftp /b/jira/home/data /b/pc/MP3
Before the first backup, each repo destination must be initialized manually. Acquire an API key from the cloud provider (or set the htpasswd for a local rest-server backend), then invoke restic init:
export B2_ACCOUNT_ID=<MY_APPLICATION_KEY_ID>
export B2_ACCOUNT_KEY=<MY_APPLICATION_KEY>
restic init --repo b2:bucket-name:new-repo
The application requires one kernel privilige, DAC_READ_SEARCH, but otherwise
runs as non-root.
These variables can be passed to the image from docker-compose.yml as needed:
| Variable | Default | Description |
|---|---|---|
| TZ | UTC | Timezone for launching cron jobs |
Container UID is 2006.
Mount these directories to the container using the helm chart:
| Container Path | Description |
|---|---|
| /home/restic-bkp/crontab | cron jobs defined by helm template |
| /home/restic-bkp/.cache/restic | cache |
| /var/log | container logs |
| /b/* | 1 or more paths to back up (read-only) |
| Secret | Description |
|---|---|
| b2-apikey | API key for B2 service |
| s3-apikey | API key for S3 service |
| repo-password | htpasswd for accessing a local rest-server |
If you want to make improvements to this image, see CONTRIBUTING.
docker pull instantlinux/restic:latest