diff options
Diffstat (limited to 'docs/sources/userguide/dockervolumes.md')
-rw-r--r-- | docs/sources/userguide/dockervolumes.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/sources/userguide/dockervolumes.md b/docs/sources/userguide/dockervolumes.md index 0c2f6cfac6..93ac37b1cc 100644 --- a/docs/sources/userguide/dockervolumes.md +++ b/docs/sources/userguide/dockervolumes.md @@ -80,23 +80,23 @@ it. Let's create a new named container with a volume to share. - $ docker run -d -v /dbdata --name dbdata training/postgres + $ sudo docker run -d -v /dbdata --name dbdata training/postgres You can then use the `--volumes-from` flag to mount the `/dbdata` volume in another container. - $ docker run -d --volumes-from dbdata --name db1 training/postgres + $ sudo docker run -d --volumes-from dbdata --name db1 training/postgres And another: - $ docker run -d --volumes-from dbdata --name db2 training/postgres + $ sudo docker run -d --volumes-from dbdata --name db2 training/postgres -You can use multiple `-volumes-from` parameters to bring together multiple data +You can use multiple `--volumes-from` parameters to bring together multiple data volumes from multiple containers. You can also extend the chain by mounting the volume that came from the `dbdata` container in yet another container via the `db1` or `db2` containers. - $ docker run -d --name db3 --volumes-from db1 training/postgres + $ sudo docker run -d --name db3 --volumes-from db1 training/postgres If you remove containers that mount volumes, including the initial `dbdata` container, or the subsequent containers `db1` and `db2`, the volumes will not @@ -122,7 +122,7 @@ we'll be left with a backup of our `dbdata` volume. You could then to restore to the same container, or another that you've made elsewhere. Create a new container. - $ sudo docker run -v /dbdata --name dbdata2 ubuntu + $ sudo docker run -v /dbdata --name dbdata2 ubuntu /bin/bash Then un-tar the backup file in the new container's data volume. |