在同一网络中的多主机中的docker网络

时间:2017-01-23 05:13:52

标签: docker docker-networking

我的系统中有两个ubuntu操作系统。我在两个ubuntu中都安装了docker,并在docker中创建了一个容器,我需要与网络进行通信......

1 个答案:

答案 0 :(得分:1)

使用选项--net=host运行您的容器。这样,两个容器都将在本地网络中具有IP地址。

一个名为ubuntu的容器示例: docker run -d --name ubuntu --net=host ubuntu