简体   繁体   English

有没有办法在不同的容器和 docker 主机中连接卷?

[英]Is there a way to connect volume within different container and docker host?

I have two Docker Host with one container each.我有两个 Docker 主机,每个主机一个容器。 For example I have a Container A (Host A) and Container B(Host B), Is there a way that all the volumes or mount inside Container A(Host A) will go straight to Container B(Host B)?例如,我有一个容器 A(主机 A)和容器 B(主机 B),有没有办法让容器 A(主机 A)内的所有卷或挂载直接进入容器 B(主机 B)? I'm using Docker Swarm but I can't figure it out with stack.我正在使用 Docker Swarm,但我无法通过堆栈弄清楚。

If i understand correctly the question, when you have two hosts, you can use a shared drive, live NFS or S3.如果我正确理解了这个问题,当您有两个主机时,您可以使用共享驱动器、实时 NFS 或 S3。 Then you mount this drive on the two hosts and you can have your volume share in container A and B.然后你在两台主机上安装这个驱动器,你可以在容器 A 和 B 中共享你的卷。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM