You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,11 @@ An utility to backup and restore [Docker volumes](https://docs.docker.com/storag
4
4
5
5
It works just as well with [Podman](https://podman.io/) volumes, just prefix each command with `podman` instead of `docker`.
6
6
7
-
**Note**: Make sure no container is using the volume before backup or restore, otherwise your data might be damaged. See [Miscellaneous](#miscellaneous) for instructions.
7
+
> [!WARNING]
8
+
> Make sure no container is using the volume before backup or restore, otherwise your data might be damaged. See [Miscellaneous](#miscellaneous) for instructions.
8
9
9
-
**Note**: When using docker-compose, make sure to backup and restore volume labels. See [Miscellaneous](#miscellaneous) for more information.
10
+
> [!TIP]
11
+
> When using docker-compose, make sure to backup and restore volume labels. See [Miscellaneous](#miscellaneous) for more information.
10
12
11
13
## Backup
12
14
@@ -20,9 +22,11 @@ For example:
20
22
21
23
will archive volume named `some_volume` to `some_archive.tar.bz2` archive file.
22
24
23
-
**Note**: `--log-driver none` option is necessary to avoid storing an entire backup in a temporary stdout JSON file. More info in [Docker logging documentation](https://docs.docker.com/config/containers/logging/configure/) and in [this issue](https://github.com/loomchild/volume-backup/issues/39).
25
+
> [!NOTE]
26
+
> The `--log-driver none` option is necessary to avoid storing an entire backup in a temporary stdout JSON file. More info in [Docker logging documentation](https://docs.docker.com/config/containers/logging/configure/) and in [this issue](https://github.com/loomchild/volume-backup/issues/39).
24
27
25
-
**WARNING**: This method should not be used under PowerShell on Windows as no usable backup will be generated.
28
+
> [!NOTE]
29
+
> This method should not be used under PowerShell on Windows as no usable backup will be generated.
26
30
27
31
### Backup to a file (deprecated)
28
32
@@ -48,8 +52,11 @@ For example:
48
52
49
53
will clean and restore volume named `some_volume` from `some_archive.tar.bz2` archive file.
50
54
51
-
**Note**: Don't forget the `-i` switch for interactive operation.
52
-
**Note** Restore will fail if the target volume is not empty (use `-f` flag to override).
55
+
> [!NOTE]
56
+
> Don't forget the `-i` switch for interactive operation.
57
+
58
+
> [!NOTE]
59
+
> Restore will fail if the target volume is not empty (use `-f` flag to override).
53
60
54
61
### Restore from a file (deprecated)
55
62
@@ -74,7 +81,7 @@ will clean and restore volume named `some_volume` from `/tmp/some_archive.tar.bz
74
81
```
75
82
docker pull ghcr.io/loomchild/volume-backup
76
83
```
77
-
**Note**: you'll need to write `ghcr.io/loomchild/volume-backup` instead of just `loomchild/volume-backup` when running the utility.
84
+
Then write `ghcr.io/loomchild/volume-backup` instead of just `loomchild/volume-backup` when running the utility.
78
85
79
86
1. Find all containers using a volume (to stop them before backing-up)
80
87
```
@@ -105,6 +112,7 @@ will clean and restore volume named `some_volume` from `/tmp/some_archive.tar.bz
105
112
```
106
113
docker run -v [volume-name]:/volume --rm --log-driver none loomchild/volume-backup backup | ssh [receiver] docker run -i -v [volume-name]:/volume --rm loomchild/volume-backup restore
107
114
```
108
-
**Note**: In case there are no traffic limitations between the hosts you can trade CPU time for bandwidth by turning off compression via `-c none` option.
115
+
> [!TIP]
116
+
> In case there are no traffic limitations between the hosts you can trade CPU time for bandwidth by turning off compression via `-c none` option.
109
117
110
118
1. Volume labels are not backed-up or restored automatically, but they might be required for your application to work (e.g. when using `docker-compose`). If you need to preserve them, create a label backup file as follows: `docker inspect [volume-name] -f "{{json .Labels}}" > labels.json`. When restoring your data, target volume needs to be created manually with labels before launching the restore script: `docker volume create --label "label1" --label "label2" [volume-name]`.
0 commit comments