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
|
2021-10-31 22:35:46 +00:00
|
|
|
version: '3.8'
|
2020-05-17 12:52:30 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
data:
|
|
|
|
name: my-data
|
|
|
|
|
|
|
|
services:
|
|
|
|
api:
|
|
|
|
image: alpine
|
|
|
|
volumes:
|
|
|
|
- data:/foo/bar
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml | .autorestic.yml
|
|
|
|
locations:
|
2024-09-27 19:55:02 +00:00
|
|
|
hello:
|
2021-10-31 22:35:46 +00:00
|
|
|
from: my-data
|
|
|
|
type: volume
|
2021-04-15 22:26:57 +00:00
|
|
|
# ...
|
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.
|