When you need to back up, restore, or migrate data from one Docker
host to another, volumes are generally the best choice.You can stop
containers using the volume, then back up the volume’s directory
(such as
/var/lib/docker/volumes/<volume-name>
).Other
alternatives, such as
bind mounts, rely on the
host machine’s filesystem having a specific directory structure
available, for example
/tmp/source
on UNIX systems
like Linux and macOS and
C:/Users/John
on Windows.
Normally, if you want to back up a data volume,
Just published by Docker: Read more