2023-04-06 12:44:32 +02:00
2023-04-20 09:39:27 +02:00
2023-04-06 12:59:23 +02:00
2023-04-06 14:09:22 +02:00

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:

      - 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/mysvc
          - 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.

Description
Backup image
Readme 91 KiB
Languages
Shell 67.1%
Dockerfile 17.5%
Makefile 15.4%