autorestic/docs/pages/location/docker.md

38 lines
548 B
Markdown
Raw Normal View History

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
2021-10-31 23:35:46 +01:00
version: '3.8'
2020-05-17 14:52:30 +02:00
volumes:
data:
name: my-data
services:
api:
image: alpine
volumes:
- data:/foo/bar
```
```yaml | .autorestic.yml
locations:
2021-10-31 23:35:46 +01:00
foo:
from: my-data
type: volume
2021-04-16 00:26:57 +02:00
# ...
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.