Search code examples
dockerdocker-swarm

How can I use a docker swarm mode manager behind a floating IP


Some providers, such as ScaleWay will give your server an IP that is not attached to a local interface on the box.

# docker swarm init --advertise-addr <my-external-ip>:2377 --listen-addr 0.0.0.0:2377
Error response from daemon: must specify a listening address
because the address to advertise is not recognized as a system address

While

# docker swarm init --advertise-addr eth0:2377

will advertise a private IP address.

How is docker swarm supposed to be setup in such an environment?


Solution

  • There is an issue with native swarm mode, when it comes to binding to a non system IP Address as docker 1.12.5. There has been multiple github issues, but the problem still persists.

    To define non system IP Address: IP Addresses used with technologies like DNAT. These IP Addresses are not set on local interface and visible to underlying operating system.

    sources: link1, link2, link3.