Skip to content

Swarm refuses unspecified listen address when advertise address is not a system address #27647

@LLParse

Description

@LLParse

Description

When creating cross-cloud Swarm clusters, traffic must be routed over the Internet. Doing so requires advertising a public IP address for each node. However, Swarm refuses to accept an unspecified listen address if the advertise address doesn't match a system address.

Is there a reason Swarm couldn't best-effort choose a network interface in this scenario, like it does when no options are provided?

Steps to reproduce the issue:

  1. Create a Docker 1.12.2 node that advertises its public IP address that isn't also a system address.
  2. Attempt to bootstrap a Swarm cluster docker swarm init --advertise-addr <public_ip>:2377

Describe the results you received:

Error response from daemon: must specify a listening address because the address to advertise is not recognized as a system address

Describe the results you expected:

Swarm initialized: current node (xxx) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join \
    --token SWMTKN-1-xxx \
    <public_ip>:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      1.12.2
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   bb80604
 Built:        Tue Oct 11 18:29:41 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.2
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   bb80604
 Built:        Tue Oct 11 18:29:41 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 5
 Running: 3
 Paused: 0
 Stopped: 2
Images: 6
Server Version: 1.12.2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 38
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null host overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-45-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.708 GiB
Name: foo
ID: APBO:R7OP:N25R:R3FS:UP4S:TPEN:AIM6:ND52:RKZV:XOP6:P5L6:GH3O
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, VirtualBox, physical, etc.):
Reproduces in AWS, GCE, and others..
DigitalOcean is not afflicted since the public IP is also a system address

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions