2017-09-22 25 views
0

私はこのように私のドッキングウィンドウコンテナを走っていますdockerのホストフォルダにglusterボリュームをマウントする方法は?

docker run -v /sys/fs/cgroup:/sys/fs/cgroup -v /opt/doc:/opt/doc \ 
--privileged=true --net=host -itd --name=gluster gluster-docker 

が、私は、コンテナ内のフォルダにボリュームをマウントします。私は私の実サーバのの/ opt /ドキュメントにデータを書き込む

mount -t glusterfs 192.168.1.100:/documents /opt/doc 

、データはコンテナの/ opt/docへのrsyncではありません。

フォルダをマウントした後、コンテナとサーバーの間にrsyncデータがありますか?

gluster-ドッキングウィンドウ:https://github.com/gluster/gluster-containers

答えて

0

は最後に、私は、ドッキングウィンドウ-CE 17.06で--mountを見つけました。

mount --bind /data/fff /data/fff 
mount --make-shared /data/fff 
docker run -v /sys/fs/cgroup:/sys/fs/cgroup -v /opt/doc:/opt/doc \ 
--privileged=true --net=host --mount \ 
type=bind,source=/data/fff,target=/data/fff,bind-propagation=rshared \ 
-itd --name=gluster gluster-docker 

その後、私はコンテナ内のフォルダにボリュームをマウント:

mount -t glusterfs 192.168.1.100:/documents /data/fff 

OK。

https://docs.docker.com/engine/admin/volumes/bind-mounts/ https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt

関連する問題