I am creating docker service
's with docker swarm. I want each of my docker services to have their own specific IP addresses on each swarm node. So my instances have multiple network interfaces (eth1, eth2 and eth3) each with their own different IP addresses. I want to be able to create docker overlay networks that are connected to a single parent network interface on each node, so that each docker service will have its own IP address on each node.
Here is my attempt at creating such a network and a service to go with it:
docker network create -d overlay \
-o parent=eth2 \
nginx1-net
docker service create \
--mode global \
--name nginx1 \
-p 30000:80/tcp \
--network nginx1-net \
nginx
The issue is that this overlay network nginx1-net
will only appear on the management node I create it on and will not appear on any other nodes.
This then causes the situation where I can access this service from any IP address on any interface (eth1, eth2 and eth3) and not just the eth2 interface I define.
How to I bind my overlay network and docker service to a single network interface?