Docker swarm service using the same VIP

We are running docker version 17.06.0-ce and I’m very new to docker (at present learning it on the fly with little network/linux knowledge/experience).

One of the environment we have is running a single manager/worker using Nginx to transfer traffic across services using DNS:Port. We are seeing the following two scenarios occurring :

  • services are being assign a VIP (I can see this in docker service inspect) that is being used and the service will fail to start with “Address already in use” error.

  • services starts and is using the same VIP as another service. This can been seen on the manager “docker service inspect”. This cause nginx to send requests to the wrong service (this can be seen in the logs).

Several question:

  1. Has anyone encounter this?

  2. how does docker swarm decide on what VIP to assign?

  3. How does docker know which VIP to use in a multi worker environment? The reason I ask is because in a single manager/worker environment you can see the VIP on the manager “docker service inspect” is the same as the worker “docker network inspect ingress” but in a multi manager/worker environment the VIP are all different.