2020-05-17 14:52:30 +02:00
|
|
|
# Docker
|
|
|
|
|
2020-05-17 18:56:14 +02:00
|
|
|
autorestic supports docker volumes directly, without needing them to be mounted to the host filesystem.
|
|
|
|
|
2020-05-17 14:52:30 +02:00
|
|
|
```yaml | docker-compose.yml
|
|
|
|
version: '3.7'
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
data:
|
|
|
|
name: my-data
|
|
|
|
|
|
|
|
services:
|
|
|
|
api:
|
|
|
|
image: alpine
|
|
|
|
volumes:
|
|
|
|
- data:/foo/bar
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml | .autorestic.yml
|
|
|
|
locations:
|
2021-04-16 00:26:57 +02:00
|
|
|
- name: hello
|
|
|
|
from: volume:my-data
|
2020-05-17 14:52:30 +02:00
|
|
|
to:
|
|
|
|
- remote
|
|
|
|
|
|
|
|
backends:
|
2021-04-16 00:26:57 +02:00
|
|
|
- name: remote
|
|
|
|
# ...
|
2020-05-17 14:52:30 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Now you can backup and restore as always.
|
|
|
|
|
|
|
|
```bash
|
2021-04-16 00:26:57 +02:00
|
|
|
autorestic backup -l hello
|
2020-05-17 14:52:30 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
```bash
|
2021-04-16 00:26:57 +02:00
|
|
|
autorestic restore -l hello
|
2020-05-17 14:52:30 +02:00
|
|
|
```
|
|
|
|
|
2021-04-16 00:26:57 +02:00
|
|
|
The volume has to exists whenever backing up or restoring.
|
2020-05-17 14:52:30 +02:00
|
|
|
|
|
|
|
> :ToCPrevNext
|