Conba is a Go CLI tool that wraps restic to provide automated, configurable backups for Docker container volumes. It auto-discovers containers and their volumes, applies filtering rules, executes the appropriate backup strategy per container, and manages snapshot retention — all driven by a YAML config file with environment variable overrides and optional container labels.
| Feature | Description |
|---|---|
| Auto-discovery | Finds all running containers and their volume mounts via Docker API |
| Label-driven config | Per-container backup strategy, retention, and commands via Docker labels |
| Three backup strategies | Snapshot (default), Command + Snapshot (pre/post hooks), Stream (stdin pipe) |
| Flexible filtering | Include/exclude by name, ID, regex, or labels; opt-in-only mode |
| Retention management | Global policy with per-container overrides; wraps restic forget --prune |
| Tagged snapshots | Every snapshot tagged with container name, ID, volume name, and hostname |
| Environment overrides | All config values overridable via CONBA_ prefixed env vars |
| Structured logging | Human-readable or JSON output at configurable levels |
- Docker (or compatible runtime with Docker socket)
- restic (installed separately for host binary; bundled in container image)
Clone and build:
git clone https://github.com/lazybytez/conba.git
cd conba
make buildAll Make targets run inside Docker containers — no local Go installation required.
Create a config file (conba.yaml):
restic:
repository: "s3:s3.amazonaws.com/my-bucket"
password_file: "/run/secrets/restic-password"
runtime:
type: docker
docker:
host: "unix:///var/run/docker.sock"
discovery:
opt_in_only: false
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
keep_yearly: 0
logging:
level: "info"
format: "human"Run a backup:
./bin/conba backupConfigure per-container behavior with Docker labels:
| Label | Values | Default | Description |
|---|---|---|---|
conba.enabled |
true, false |
— | Override include/exclude filters |
conba.strategy |
snapshot, command-snapshot, stream |
snapshot |
Backup strategy |
conba.pre-command |
shell command | — | Pre-backup command (command-snapshot) |
conba.post-command |
shell command | — | Post-backup command (command-snapshot) |
conba.stream-command |
shell command | — | Stream command (stream strategy) |
conba.stdin-filename |
filename | stdin |
Filename for --stdin-filename |
conba.retention |
Nd,Nw,Nm,Ny |
global | Per-container retention override |
conba.exclude-volumes |
comma-separated | — | Volume names to skip |
conba backup # Discover, filter, and backup all matching volumes
conba backup --dry-run # Show what would be backed up without executing
conba forget # Apply retention policies and prune
conba snapshots # List snapshots
conba version # Print version info
All build operations run inside Docker containers via Make:
make build # Build the binary
make test # Run tests with race detector
make lint # Run golangci-lint
make coverage # Run tests with coverage report
make fmt # Format code
make clean # Remove build artifacts| Branch | Purpose |
|---|---|
main |
Stable — all PRs target here |
feature/* |
New features |
fix/* |
Bug fixes |
Conventional commits enforced via commitlint:
prefix(scope): subject
Prefixes: feat, fix, build, chore, ci, docs, perf, refactor, revert, style, test, sec
Contributions are welcome. See CONTRIBUTING.md.
License - Contributing - Code of Conduct - Security - Issues - Pull Requests