Sign inSign up

knechtd/duplicati-with-docker

By knechtd

•Updated 22 days ago

Unofficial Duplicati image with Docker CLI and lifecycle hooks for consistent container backups.

Image
Security
Developer tools
Databases & storage
0

936

knechtd/duplicati-with-docker repository overview

⁠Duplicati with Docker

An unofficial extension of the official Duplicati⁠ Docker image with Docker CLI support and backup lifecycle hooks for Docker workloads.

It is not a fork of Duplicati. The image is built directly on top of the official duplicati/duplicati⁠ image and only adds the Docker integration described below.

Source code and issue tracking are available on GitHub⁠.

⁠What this image adds

  • Docker CLI access
  • a pre-backup hook that stops eligible running containers
  • a post-backup hook that restarts only containers stopped by the pre-backup hook
  • the backup.keepRunning=true opt-out label
  • rollback if container shutdown fails part-way through

The resulting backup lifecycle is:

Duplicati starts backup
        │
        ▼
Pre-backup hook
        │
        ├── backup.keepRunning=true ──► keep running
        │
        └── otherwise ────────────────► stop + record
                                              │
                                              ▼
                                      Duplicati backup
                                              │
                                              ▼
                                      Post-backup hook
                                              │
                                              ▼
                                      Restart recorded
                                         containers

Containers that were already stopped before the backup remain stopped.

The Duplicati container itself is automatically excluded from shutdown.

⁠Quick start

services:
  duplicati:
    image: knechtd/duplicati-with-docker:stable
    container_name: duplicati
    restart: unless-stopped

    ports:
      - "8200:8200"

    volumes:
      - duplicati-data:/data
      - /var/run/docker.sock:/var/run/docker.sock

      # Example source and destination mounts
      - /srv:/source:ro
      - /mnt/backups:/backups

volumes:
  duplicati-data:

Configure the following advanced options on Duplicati jobs that should use the container lifecycle:

--run-script-before-required=/hooks/stop_containers.sh
--run-script-after=/hooks/start_containers.sh
--run-script-timeout=600s

The pre-backup hook is intentionally configured as required. If containers cannot be placed into the expected backup state, the backup will not continue.

⁠Keeping containers running

By default, running containers are eligible to be stopped.

Add this label to containers that must remain available during the backup:

labels:
  backup.keepRunning: "true"

The pre-backup hook records only containers it successfully stops. The post-backup hook uses this state to restore exactly those containers.

If shutdown fails part-way through, the hook attempts to roll back by restarting containers it already stopped.

⁠Docker socket

The Docker socket must be available inside the Duplicati container:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock

Security warning

Access to the Docker socket effectively provides extensive, root-equivalent control over the Docker host. Only use this image on trusted systems and restrict access to the Duplicati service.

When using Duplicati's UID/GID options, the resulting user must also have permission to access the Docker socket.

⁠Tags

stable and latest point to the latest upstream Duplicati stable release that has been reviewed and published by this project.

Version-specific and commit-specific tags are also published, for example:

knechtd/duplicati-with-docker:stable
knechtd/duplicati-with-docker:2.4.0.0-stable
knechtd/duplicati-with-docker:sha-dd99bfa

Upstream Duplicati releases are tracked using Renovate and pass the project's integration tests before publication.

⁠Upstream and project status

This project is unofficial and is not affiliated with, endorsed by, or maintained by the Duplicati project.

Duplicati itself and its base image remain maintained and licensed by the upstream Duplicati project. This repository's own additions are licensed under the MIT License.

⁠AI assistance disclosure

Generative AI tools were used to assist in creating parts of the source code, documentation, tests, and project configuration.

AI-generated output was reviewed, adapted where necessary, and tested by humans before being incorporated into the project. Responsibility for the contents, behavior, security, and published releases remains with the project maintainer.

Tag summary

Content type

Image

Digest

sha256:b78aa44a1…

Size

205.1 MB

Last updated

22 days ago

docker pull knechtd/duplicati-with-docker