【发布时间】:2014-12-09 17:17:08
【问题描述】:
首先,对不起我的英语不好。
我们有一个 ubuntu 服务器,它有 2 个 eth 接口和 2 个不同的 ip。我们想用 2 个 docker 容器托管 2 个应用程序,并且在容器中我们必须使用自域(我们重定向到 ips 的域)ip 作为网关。
换句话说,当我们附加容器 1(xx.xx.xx.98 及其域的主机)并运行“curl http://checkip.dyndns.org”时,我们希望在 dyndns.org 中看到 xx.xx.xx.98 ip回复。在容器 2(xx.xx.xx.99 及其域的主机)中,我们希望在 dyndns.org 响应中看到 xx.xx.xx.99 ip。
有没有可能,如果有,我们该怎么做?
此外,我阅读了这些文章,发现我们只能为 docker 使用一个桥接器,这意味着所有 docker 容器必须使用相同的网关。是真的吗?
https://docs.docker.com/articles/networking/#bridge-building http://jpetazzo.github.io/2013/10/16/configure-docker-bridge-network/
【问题讨论】:
标签: ubuntu networking docker ifconfig