Expect my newly reconfigured docker host to become the swarm leader AND exposes port 2377 to the outside world.
Actual behavior
swarm started and all services work as expected, but: port 2377 is not reachable from the outside world. (Not even from the inside world: ‘lsof -i -P -n | grep LISTEN’ doesn’t show any open port 2377 on any ethernet card.)
Am I doing something wrong? Would like to connect a second host…
The listen-address you specified is the default, so you don’t have to specify it when you initialize the swarm. I have a 2-node cluster running on Ubuntu 16.04 that’s running 5 services.
Even though lsof does not show the server listening on port 2377, I can join a node to the cluster using
Thanks, I’m sure it’s not a general problem. But that’s the docker4mac section and it seems not to work here.
If I want to set up a single host swarm - how can I disable the listening? Binding to 127.0.0.1?
No, doesn’t work. Tried to find access to that little VM (xhyve clone), but have no idea how. So I could at least check if the port is open locally within that VM…
u can try using docker in docker ‘docker:1.12.0-rc2-dind’ to build docker for mac swarm cluster or expose the ports in dind for multiple local macs swarm cluster.
So this may be due to the difference between the typical swarm mode that you would create on linux machines vs. the simulated methods that Docker for Mac goes though to make you think it’s really running on your localhost Mac when it’s actually running on the xhyve linux VM. I don’t have the specific steps in front of me but if you want your DfM docker instance to be in a multi-server swarm mode you’ll need to google for extra steps/hacks, as it’s kinda beyond expected behavior for DfM/DfW.
If I was wanting to build a multi-server swarm mode locally I’d still use docker-machine with virtualbox.