autorestic/docs/markdown/location/docker.md

44 lines
614 B
Markdown
Raw Normal View History

2020-05-17 12:52:30 +00:00
# Docker
2020-05-17 16:56:14 +00:00
autorestic supports docker volumes directly, without needing them to be mounted to the host filesystem.
2020-05-17 12:52:30 +00: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-15 22:26:57 +00:00
- name: hello
from: volume:my-data
2020-05-17 12:52:30 +00:00
to:
- remote
backends:
2021-04-15 22:26:57 +00:00
- name: remote
# ...
2020-05-17 12:52:30 +00:00
```
Now you can backup and restore as always.
```bash
2021-04-15 22:26:57 +00:00
autorestic backup -l hello
2020-05-17 12:52:30 +00:00
```
```bash
2021-04-15 22:26:57 +00:00
autorestic restore -l hello
2020-05-17 12:52:30 +00:00
```
2021-04-15 22:26:57 +00:00
The volume has to exists whenever backing up or restoring.
2020-05-17 12:52:30 +00:00
> :ToCPrevNext