Actions
Back Up and Share Docker Volumes » History » Revision 2
« Previous |
Revision 2/3
(diff)
| Next »
Viacheslav Anzhiganov, 02/19/2025 07:06 PM
Back Up and Share Docker Volumes¶
Normally, if you want to back up a data volume, you run a new container using the volume you want to back up, then execute the tar command to produce an archive of the volume content:
docker run --rm \
-v "$VOLUME_NAME":/backup-volume \
-v "$(pwd)":/backup \
busybox \
tar -zcvf /backup/my-backup.tar.gz /backup-volume
To restore a volume with an existing backup, you can run a new container that mounts the target volume and executes the tar command to decompress the archive into the target volume.
Useful links¶
Updated by Viacheslav Anzhiganov about 2 months ago · 3 revisions