I have a bit of a problem with docker swarm. I create 2 instances on DigitalOcean and i'll refer to them with public ip address 100.0.0.1 and 100.0.0.2 respectively. I ssh-ed into the first droplet as root and tried running the command docker swarm init
and it returned an error that eth0
is bound to 2 ip addresses the public ip address and a private ip address.
I then tried running docker swarm init --advertise-addr 10.0.0.1
as to prevent this and the swarm works. But whenever I try connecting to it from anywhere either the second droplet or my local machine using the join command it prints out it returns Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the "docker info" command to see the current swarm status of your node.
But it never connects to the swarm.
I tried running the same on ec2 without advertise-addr and it works perfectly the problem only arises when I am using DigitalOcean. Any help?
Thanks.
It appears that at the time of writing DigitalOcean's one-click-app for Docker is broken and fails in connecting swarm nodes for some reason. The only workaround I found was by running a normal ubuntu (or any other OS) image and manually installing Docker. That seemed to fix the problem.