Go to file
Max Cohen 6bb54fd2b9 Release version 0.3.3 2025-04-12 16:16:52 +02:00
examples Recommend init process 2025-04-12 16:10:02 +02:00
.env Release version 0.3.3 2025-04-12 16:16:52 +02:00
CHANGELOG.md Release version 0.3.3 2025-04-12 16:16:52 +02:00
Dockerfile Bump alpine 2025-04-12 16:11:34 +02:00
LICENSE Initial commit 2024-05-06 15:34:47 +00:00
README.md Add latest tag 2025-04-12 16:13:41 +02:00
entrypoint.sh Allow to backup and prune simultaneously 2025-04-12 16:08:16 +02:00

README.md

BorgContainer

Docker volume backup on a schedule.

Usage

Run a backup

docker run --rm backup backup

Schedule a backup

Mount a crontab to /etc/crontab, such as:

0 1 * * * /entrypoint backup
services:
  backup:
    image: git.zagouri.org/max/borgcontainer:latest
    init: true
    environment:
      - BORG_REPO=/tmp/borgrepo
      - BORG_PASSPHRASE=secretpassphrase
    volumes:
      # Mount docker socket
      - /var/run/docker.sock:/var/run/docker.sock:ro
      # Mount crontab with scheduled backups
      - ./crontab:/etc/crontab

Configuration

Environment variables

table with environment variables and their default values and descriptions

Variable Default Example Description
BORG_REPO ssh://user@host:/data/repo Path to the borg repository
BORG_PASSPHRASE TOKEN Passphrase to use for the encryption
BORG_CRON_SCHEDULE 0 1 * * * Crontab to schedule the backups

Examples

See examples/.

Build

Update .env and Run

docker buildx build --push --platform=linux/amd64,linux/arm64/v8 -t git.zagouri.org/max/borgcontainer:$(. .env && echo $VERSION) -t git.zagouri.org/max/borgcontainer:latest .