Skip to content

patte/zfs-autobackup-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zfs-autobackup-docker

A batteries included docker image for running zfs-autobackup.

Features:

  • SSH agent forwarding
  • SSH config with 48h connection persistence
  • Known hosts file, no --strict-host-key-checking=no
  • Based on ubuntu:24.04
  • GitHub Action to build (daily) and push the image to ghcr.io
  • Version pinning for zfs-autobackup (currently using the latest version)

Image:

ghcr.io/patte/zfs-autobackup:main

Usage

First create a known_hosts file for the servers you want to connect to. This will be bind mounted into the container.

ssh-keyscan HOST >> known_hosts

Then run the container with the following command. Note that --privileged and -v /dev:/dev are required so that ZFS from inside the container can access the host's ZFS devices.

sudo podman run --rm \
  --privileged \
  -v /dev:/dev \
  --env SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
  -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK \
  -v ./known_hosts:/root/.ssh/known_hosts \
  ghcr.io/patte/zfs-autobackup:main --help

Or just run the script zfs-autobackup, which does the same thing.

./zfs-autobackup --version

Example

Just run ./zfs-autobackup where you would run zfs-autobackup e.g.:

./zfs-autobackup -v --ssh-target user@HOST --strip-path=1 --keep-source=10 --keep-target=10 HOST backupPool

Build

To manually build the image, run the following command:

sudo podman build -t localhost/zfs-autobackup .

About

A batteries included docker image for running zfs-autobackup

Topics

Resources

License

Stars

Watchers

Forks

Packages