docker 使用Data Volume 共享文件

Adding a data volume

You can add a data volume to a container using the -v flag with the docker run command. You can use the -v multiple times in a single docker run to mount multiple data volumes. Let's mount a single volume now in our web application container.

$ sudo docker run  -P --name web -v  ~/Workspace:/workspace ubuntu

You can then use the --volumes-from flag to mount the /dbdata volume in another container.

$ sudo docker run -it --volumes-from workspace -v ~/Workspace ubuntu /bin/bash
 
posted @ 2014-11-14 12:09  superping  阅读(495)  评论(0编辑  收藏  举报