1

I'm really a docker newbie, please forgive my lack of skills on specifying questions.

Now I've met a scene in production where I'd like to use docker swarm to connect different machines together in a docker network.

But each host machine may have multiple physical NIC(eth0, eth1, etc...), thus different IPs, and each time I orchestrate the system, I'd like to initialize a new network for each container, letting the container use a particular IP among NIC's IP. But each container using the IP of each NIC, not under docker0.

I've read the doc on docker 17.06ce mentioning using DOCKER-USER flag, but I can't quite understand that.

Using host network is not the best option for me because that will occupy the port globally. Thanks in advance.

Kai Wu
  • 11
  • 3
  • Have you think in network-mode=host? With that the container gets and share the same interfaces as the host. *With the network set to host a container will share the host’s network stack and all interfaces from the host will be available to the container.* https://docs.docker.com/engine/reference/run/#example – Robert Jul 06 '17 at 01:51
  • @Robert Thanks for your advice, but using host network isn't the best option for me, because in that way the container will occupy some port globally. I'm trying to modify `iptables` manually on `DOCKER-USER` in filter table. But I'm not sure how to write the rules. – Kai Wu Jul 06 '17 at 03:34

0 Answers0