Star

Created With

linkDocker

autorestic supports docker volumes directly, without needing them to be mounted to the host filesystem.

Available since version 0.13

Let see an example.

docker-compose.yml
1version: '3.7'

2

3volumes:

4 data:

5 name: my-data

6

7services:

8 api:

9 image: alpine

10 volumes:

11 - data:/foo/bar

.autorestic.yml
1locations:

2 hello:

3 from: 'volume:my-data'

4 to:

5 - remote

6 options:

7 forget:

8 keep-last: 14 # Useful for limitations explained belowd

9

10backends:

11 remote: ...

Now you can backup and restore as always.

1autorestic -l hello backup

1autorestic -l hello restore

If the volume does not exist on restore, autorestic will create it for you and then fill it with the data.

linkLimitations

Unfortunately there are some limitations when backing up directly from a docker volume without mounting the volume to the host:

  1. Incremental updates are not possible right now due to how the current docker mounting works. This means that it will take significantely more space.
  2. Exclude patterns and files also do not work as restic only sees a compressed tarball as source and not the actual data.

If you are curious or have ideas how to improve this, please read more here. Any help is welcomed 🙂

DockerLimitations

Home Quick Start Installation Configuration

Locationschevron_right
Backendchevron_right
CLIchevron_right

Examples

QA

Contributors