π― Stats powered by ClonePulse
dar-backup-image
is a Docker image that bundles the powerful dar (Disk ARchiver) utility with the robust Python wrapper dar-backup
. Together, they provide a flexible, automated, and verifiable backup solution suited for long-term data retention.
This image makes it easy to run dar-backup
in a clean, isolated container environment β perfect for use in cron jobs, systemd timers, or CI pipelines. Whether you're backing up from FUSE-based cloud storage or verifying years-old archives, this image delivers consistent, reproducible results without requiring dar or Python tooling on the host.
At its core is dar-backup
, a Python-powered CLI that wraps dar and par2 for reliable full, differential, and incremental backups. It validates archives, performs restore tests, manages catalog databases, and optionally generates redundancy files to protect against bit rot.
π§ Highlights
Automated backup logic with dar-backup: tested, restore-verified, and redundancy-enhanced
Stateless and portable: no installation required on the host system
Ideal for FUSE filesystems: works without root, designed for user-space storage
Includes par2 for integrity protection
Ready for CI / cron / systemd: just mount volumes and go
The default entrypoint of this image is
dar-backup
, meaning any docker run invocation without a command will start dar-backup directly. You can also run dar, par2, or a shell interactively by overriding the entrypoint.
Use dar-backup-image
to centralize and simplify your backup operations β with restore confidence built in.
- π¦ dar-backup image for container backups and more
- ποΈ dar-backup-image
- π Table of Contents
- Builds uploaded to Docker Hub
- π§ Hands-on Demo:
dar-backup
in a Container - Useful links
- License
- Docker Hub image repo
- Description
- How to test
- π§ Image Tags
- π§° Volumes / Runtime Configuration
- π Usage Example
- run-backup.sh
- π Discover Image Metadata
- Image deep diving
- Common
dar-backup
commands - Release procedure
Tag | dar-backup version |
Git Revision | Docker Hub |
---|---|---|---|
0.5.11 | 0.8.2 | 30f25b5 | tag:0.5.11 |
0.5.10 | 0.8.1 | 1d684b9 | tag:0.5.10 |
0.5.9 | 0.8.1 | 34c6e68 | tag:0.5.9 |
0.5.8 | 0.8.0 | 500d801 | tag:0.5.8 |
0.5.7 | 0.8.0 | ddf8afb | tag:0.5.7 |
Curious how it all works in practice?
Check out the π step-by-step demo, which walks through:
- A full backup from mounted directories
- Archive listing and contents inspection
- Selective file restore (e.g.,
.JPG
only) - Output logs, par2 generation, and verification
All performed using docker run
β no host installation required.
Topic | Link |
---|---|
dar-backup |
dar-backup on Github |
dar-backup-image |
dar-backup-image |
Docker Hub repo |
Docker Hub |
dar |
Disk ARchive |
dar-backup-image
is licensed under GPL 3
or later.
If you are unfamiliar with that license, take a look at the LICENSE file in this repo
You can see publicly available dar-backup
docker images on Docker Hub.
Those fond of curl can do this:
curl -s https://hub.docker.com/v2/repositories/per2jensen/dar-backup/tags | jq '.results[].name'
A minimal, Dockerized backup runner using dar (Disk ARchive) and dar-backup, ready for automated or manual archive creation and restore.
This is early, the dar-backup
images are not tested well, do not trust it too much. It will mature over time :-)
This image includes:
- dar
- par2
- python3
- gosu
- dar-backup (my
dar
Python based wrapper) - Clean, minimal Ubuntu 24.04 base (~170 MB)
- CIS-aligned permissions and user-drop via gosu
# make new base and development image
make all-dev
# run FULL, DIFF and INCR backups in a temp directory
make test
Two images are built:
-
A base image which currently is a slimmed down ubuntu 24.04 image
-
dar-backup image is installed on top of the base image
Some images are put on DockerHub.
The Release procedure results in two things:
- An image pushed to Docker Hub.
- Metadata about the image put in build-history.md.
For now I am not using latest
, as the images have not yet demonstrated their quality.
I am currently going with:
Tag | Description | Docker Hub | Example Usage |
---|---|---|---|
:0.x.y |
Versioned releases following semantic versioning | β Yes | docker pull per2jensen/dar-backup:0.5.6 |
:stable |
Latest "good" and trusted version; perhaps :rc |
β Yes | docker pull per2jensen/dar-backup:stable |
:dev |
Development version; may be broken or incomplete | β No | docker run dar-backup:dev |
The default dar-backup.conf baked into the image assumes the directories mentioned below.
The locations should be mounted with actual directories on your machine for backups.
Directories in file system | Directories in container | Purpose |
---|---|---|
/some/dir/to/backup/ | /data |
Source directory for backup |
/keep/backups/here/ | /backup |
dar archives and .par2 files are put here |
/restore/tests/ | /restore |
Optional restore target |
/backup/definitions/ | /backup.d |
Contains backup definition files |
The mapping between physical directories on your file system and the expected directories inside the container is performed by the -v /physical/dir:/container/dir
options (see example below).
Determine if you want to built an image yourself, or use one of mine from Docker Hub.
# make a container
$ make FINAL_VERSION=dev DAR_BACKUP_VERSION=0.8.0 dev # make a local development image
# check
$ docker images |grep "dev"
dar-backup dev e72a7fd82a4b 19 seconds ago 174MB
# Set IMAGE to your own
export IMAGE=dar-backup:dev # your own locally build image
# Or set IMAGE to one of mine on Docker Hub
export IMAGE=per2jensen/dar-backup:0.5.6
Now run dar-backup
in the container
# Run it (from script or manually)
# Configuration
export DATA_DIR=/tmp/test-data # the data to backup
export BACKUP_DIR=/tmp/test-backups # the directory that keeps the backups
export RESTORE_DIR=/tmp/test-restore # the directory used for restore tests during backup verification
export BACKUP_D_DIR=/tmp/test-backup.d # the directory keeping the `backup definitions`
docker run --rm \
-e RUN_AS_UID=$(id -u) \
-v "$DATA_DIR":/data \
-v "$BACKUP_DIR":/backup \
-v "$RESTORE_DIR":/restore \
-v "$BACKUP_D_DIR":/backup.d \
"$IMAGE" \
-F --log-stdout --config /etc/dar-backup/dar-backup.conf
The --config
option to dar-backup
is referencing the baked-in config file. In other words, the config file is part of the container image. To use another config file you have multiple options:
- Modify the baked-in and build a new image.
- Use --config option to point to another (for example: /backup/dar-backup.conf, which in the example above means you physically put it on "$BACKUP_DIR"/dar-backup.conf)
The container uses gosu to drop root privileges. Pass -e RUN_AS_UID=$(id -u) to run as your own user inside the container.
This script runs a backup using a dar-backup Docker image.
It runs a backup based on the specified type (FULL, DIFF, INCR) with the following features:
Using the baked in dar-backup.conf file (se more here).
Uses the .darrc file from the PyPI package added to the image, see image details here
.darrc contents
It print log messages to stdout.
Expected directory structure when running this script:
WORKDIR/
βββ backups/ # Where backups are stored
βββ backup.d/ # Backup definitions
βββ data/ # Data to backup
βββ restore/ # Where restored files will be placed
If envvar WORKDIR is set, the script uses that as the base directory.
If WORKDIR is not set, the script uses the directory where the script is located as the base directory.
More info on backup definitions in general
View supplied default
backup definition
If IMAGE is not set, the script defaults to dar-backup:dev
.
You can see available images on [Docker Hub here)(https://hub.docker.com/r/per2jensen/dar-backup/tags)
If RUN_AS_UID is not set, it defaults to the current user's UID. - running the script as root is not allowed, the script will exit with an error.
You can configure the directory layout by setting the following environment variables:
-
DAR_BACKUP_DIR: Directory for backups (default: WORKDIR/backups)
-
DAR_BACKUP_DATA_DIR: Directory for data to backup (default: WORKDIR/data)
-
DAR_BACKUP_D_DIR: Directory for backup definitions (default: WORKDIR/backup.d)
- Take a look at the supplied
default
backup definition
- Take a look at the supplied
-
DAR_BACKUP_RESTORE_DIR: Directory for restored files (default: WORKDIR/restore)
WORKDIR=/path/to/your/workdir IMAGE=`image` ./run-backup.sh -t FULL|DIFF|INCR
Learn what's inside the dar-backup
image: program versions, build metadata, and available versions.
Run the image with different entrypoints to check the bundled versions of dar-backup
, dar
, and par2
:
IMAGE=per2jensen/dar-backup:0.5.1
# dar-backup version
docker run --rm --entrypoint "dar-backup" "$IMAGE" -v
# dar version
docker run --rm --entrypoint dar "$IMAGE" --version
# par2 version
docker run --rm --entrypoint par2 "$IMAGE" --version
# Or get them all in one go:
docker run --rm --entrypoint "" "$IMAGE" \
bash -c "dar-backup -v; dar --version; par2 --version"
docker pull per2jensen/dar-backup:0.5.1
docker inspect per2jensen/dar-backup:0.5.1 | jq '.[0].Config.Labels'
{
"org.opencontainers.image.base.created": "2025-06-19T13:38:32Z",
"org.opencontainers.image.created": "2025-06-19T13:38:32Z",
"org.opencontainers.image.description": "Container for DAR-based backups using dar-backup",
"org.opencontainers.image.ref.name": "ubuntu",
"org.opencontainers.image.source": "https://hub.docker.com/r/per2jensen/dar-backup",
"org.opencontainers.image.version": "0.5.1"
}
# Show first 100 available tags
curl -s 'https://hub.docker.com/v2/repositories/per2jensen/dar-backup/tags?page_size=100' \
| jq -r '.results[].name' | sort -V
Although dar-backup
is the primary CLI inside the container, you can also run dar directly from the image to take manual backups or inspect archives β perfect for advanced workflows or testing.
Here's a minimal example of how to use dar directly:
export DATA_DIR=/tmp/test-data
export BACKUP_DIR=tmp/test-backups
export IMAGE=per2jensen/dar-backup:0.5.6
touch /tmp/test-data/TEST.txt
docker run --rm -v "$DATA_DIR":/data -v "$BACKUP_DIR":/backup --entrypoint dar "$IMAGE" -c /backup/myarchive -R /data
Example output
No terminal found for user interaction. All questions will be assumed a negative answer (less destructive choice), which most of the time will abort the program.
--------------------------------------------
1 inode(s) saved
including 0 hard link(s) treated
0 inode(s) changed at the moment of the backup and could not be saved properly
0 byte(s) have been wasted in the archive to resave changing files
0 inode(s) with only metadata changed
0 inode(s) not saved (no inode/file change)
0 inode(s) failed to be saved (filesystem error)
0 inode(s) ignored (excluded by filters)
0 inode(s) recorded as deleted from reference backup
--------------------------------------------
Total number of inode(s) considered: 1
--------------------------------------------
EA saved for 0 inode(s)
FSA saved for 1 inode(s)
--------------------------------------------
This shows that even without dar-backup, you can still invoke dar manually β helpful for debugging, recovery scenarios, or power-user workflows.
π§ Tip: You can also run par2 directly using --entrypoint par2 if needed.
dar-backup --full-backup
dar-backup --differential-backup
dar-backup --incremental-backup
dar-backup --list
dar-backup --list-contents <archive_name>
dar-backup --restore <archive_name>
make FINAL_VERSION=0.5.2 DAR_BACKUP_VERSION=0.8.0 final-dryrun
π FINAL DRY-RUN
FINAL_VERSION = 0.5.2
DAR_BACKUP_VERSION = 0.8.0
UBUNTU_VERSION = 24.04
BASE_IMAGE_NAME = dar-backup-base
FINAL_IMAGE_NAME = dar-backup
DOCKERHUB_REPO = per2jensen/dar-backup
π¨ Image tags:
- dar-backup:0.5.2
- per2jensen/dar-backup:0.5.2
π¦ Labels (subset):
org.opencontainers.image.version = 0.5.2
org.dar-backup.version = 0.8.0
org.opencontainers.image.revision = 5cca8a9
org.opencontainers.image.created = 2025-07-13T14:06:57Z
β
Dry-run done. Run 'make final' to build.
make FINAL_VERSION=0.5.2 DAR_BACKUP_VERSION=0.8.0 final
...
π Verifying 'dar-backup --version' matches DAR_BACKUP_VERSION (0.8.0 )
β
dar-backup --version is correct: 0.8.0
make[1]: Leaving directory '/home/pj/git/dar-backup-image'
make[1]: Entering directory '/home/pj/git/dar-backup-image'
π Verifying OCI image labels on dar-backup:0.5.2
β
org.opencontainers.image.authors: Per Jensen <dar-backup@pm.me>
β
org.opencontainers.image.base.name: ubuntu
β
org.opencontainers.image.base.version: 24.04
β
org.opencontainers.image.created: 2025-07-13T14:09:02Z
β
org.opencontainers.image.description: Container for DAR-based backups using
β
org.opencontainers.image.licenses: GPL-3.0-or-later
β
org.opencontainers.image.ref.name: per2jensen/dar-backup:0.5.2
β
org.opencontainers.image.revision: 5cca8a9
β
org.opencontainers.image.source: https://github.com/per2jensen/dar-backup-image
β
org.opencontainers.image.title: dar-backup
β
org.opencontainers.image.url: https://hub.docker.com/r/per2jensen/dar-backup
β
org.opencontainers.image.version: 0.5.2
π All required OCI labels are present.
make[1]: Leaving directory '/home/pj/git/dar-backup-image'
This builds the image and runs the test cases against it.
make FINAL_VERSION=0.5.6 DAR_BACKUP_VERSION=0.8.0 dry-run-release
...
2025-07-13 14:12:13,182 - INFO - Type of backup: INCR
2025-07-13 14:12:13,183 - INFO - ======================================
2025-07-13 14:12:13,184 - INFO - ===> Starting INCR backup for /backup.d/default
[14:12:13] [~] Not a terminal β progress bar skipped. rich_progress.py:62
2025-07-13 14:12:13,219 - INFO - INCR backup completed successfully.
2025-07-13 14:12:13,435 - INFO - Catalog for archive '/backups/default_INCR_2025-07-13' added successfully to its manager.
2025-07-13 14:12:13,436 - INFO - Starting verification...
[14:12:13] [~] Not a terminal β progress bar skipped. rich_progress.py:62
2025-07-13 14:12:13,504 - INFO - Archive integrity test passed.
2025-07-13 14:12:13,569 - INFO - No files between 1MB and 20MB for verification, skipping
2025-07-13 14:12:13,569 - INFO - Verification completed successfully.
2025-07-13 14:12:13,569 - INFO - Generate par2 redundancy files.
2025-07-13 14:12:13,570 - INFO - 1/1: Now generating par2 files for /backups/default_INCR_2025-07-13.1.dar
2025-07-13 14:12:13,603 - INFO - 1/1: Done
2025-07-13 14:12:13,603 - INFO - par2 files completed successfully.
2025-07-13 14:12:13,603 - INFO - END TIME: 1752415933
β INCR backup (requires DIFF first)
make[1]: Leaving directory '/home/pj/git/dar-backup-image/.dryrun'
β
Dry-run complete β no changes made to working directory
...
Set DOCKER_USER and DOCKER_TOKEN envvars first.
make FINAL_VERSION=0.5.6 DAR_BACKUP_VERSION=0.8.0 release
...
π Skipping verify-cli-version (will be run by release)
π Verifying OCI image labels on dar-backup:0.5.6
β
org.opencontainers.image.authors: Per Jensen <dar-backup@pm.me>
β
org.opencontainers.image.base.name: ubuntu
β
org.opencontainers.image.base.version: 24.04
β
org.opencontainers.image.created: 2025-07-13T17:08:24Z
β
org.opencontainers.image.description: Container for DAR-based backups using
β
org.opencontainers.image.licenses: GPL-3.0-or-later
β
org.opencontainers.image.ref.name: per2jensen/dar-backup:0.5.6
β
org.opencontainers.image.revision: b583e85
β
org.opencontainers.image.source: https://github.com/per2jensen/dar-backup-image
β
org.opencontainers.image.title: dar-backup
β
org.opencontainers.image.url: https://hub.docker.com/r/per2jensen/dar-backup
β
org.opencontainers.image.version: 0.5.6
π All required OCI labels are present.
π Verifying 'dar-backup --version' matches DAR_BACKUP_VERSION (0.8.0 )
β
dar-backup --version is correct: 0.8.0
π Logging in to Docker Hub (2FA enabled)...
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin
Login Succeeded
π Pushing image per2jensen/dar-backup:0.5.6
The push refers to repository [docker.io/per2jensen/dar-backup]
5f70bf18a086: Layer already exists
dab3496ba942: Layer already exists
6dbcafa4e191: Layer already exists
50838a8b9a7e: Pushed
db49808a00f3: Pushed
0dde0d1808a7: Pushed
76550f3c9c5b: Pushed
45a01f98e78c: Layer already exists
0.5.6: digest: sha256:ef94dae75ecc698f4e81d49020fcf1c3d0490d3c257f97c3dd33c974d6e1c496 size: 2812
β
Log entry added. Total builds: 4
{
"build_number": 3,
"tag": "0.5.6",
"dar_backup_version": "0.8.0",
"base_image": "dar-backup-base:24.04-0.5.6",
"full_image_tag": "per2jensen/dar-backup:0.5.6",
"git_revision": "b583e85",
"created": "2025-07-13T17:08:57Z",
"dockerhub_tag_url": "https://hub.docker.com/r/per2jensen/dar-backup/tags/0.5.6",
"digest": "sha256:ef94dae75ecc698f4e81d49020fcf1c3d0490d3c257f97c3dd33c974d6e1c496",
"image_id": "sha256:3494bd51f42da13d11f6528e1c2c51f6b1094eb66a01e9af4ba98c0674f21ffd"
}
π Checking if doc/build-history.json changed
[main 93b01da] build-history: add 0.5.6 metadata
1 file changed, 35 insertions(+)
β
doc/build-history.json updated and committed
β
Release complete for: per2jensen/dar-backup:0.5.6