From 8923c30b4ad304b8ff285afae77bc70b1a2036cc Mon Sep 17 00:00:00 2001 From: Ilya Gusev Date: Mon, 7 Dec 2015 15:17:03 +0300 Subject: [PATCH] Update dockervolumes.md added rm flag to backup/restore commands in examples Signed-off-by: Ilya Gusev --- docs/userguide/dockervolumes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/userguide/dockervolumes.md b/docs/userguide/dockervolumes.md index cb450c33be..8c52c13be4 100644 --- a/docs/userguide/dockervolumes.md +++ b/docs/userguide/dockervolumes.md @@ -246,7 +246,7 @@ backups, restores or migrations. We do this by using the `--volumes-from` flag to create a new container that mounts that volume, like so: - $ docker run --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata + $ docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata Here we've launched a new container and mounted the volume from the `dbstore` container. We've then mounted a local host directory as @@ -262,7 +262,7 @@ elsewhere. Create a new container. Then un-tar the backup file in the new container's data volume. - $ docker run --volumes-from dbstore2 -v $(pwd):/backup ubuntu bash -c "cd /dbdata && tar xvf /backup/backup.tar" + $ docker run --rm --volumes-from dbstore2 -v $(pwd):/backup ubuntu bash -c "cd /dbdata && tar xvf /backup/backup.tar" You can use the techniques above to automate backup, migration and restore testing using your preferred tools.