1
0
mirror of https://github.com/docker/cli.git synced 2026-01-16 20:22:36 +03:00

Merge pull request #18468 from iGusev/patch-1

added rm flag to backup/restore commands in examples
Upstream-commit: ce7ae7868e12dcb331c4e427630bf9615c959055
Component: engine
This commit is contained in:
Tibor Vass
2015-12-07 13:38:16 +01:00

View File

@@ -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.