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
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_hostsThen 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 --helpOr just run the script zfs-autobackup, which does the same thing.
./zfs-autobackup --versionJust 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 backupPoolTo manually build the image, run the following command:
sudo podman build -t localhost/zfs-autobackup .