Unable to add worker nodes to Docker Swarm

Hi, I hope this is the correct place for this question. If it’s not, I apologize, and will delete and recreate this post in the correct place

I have been following this guide: https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts

My manager machine is running the latest version of Windows 10 and the two machines I’ve tried to add as workers are both the latest version of OS X.

I ran this command on my manager machine:
docker swarm init --advertise-addr 192.168.xx.xx

As expected this gave me the command to use on the worker machines to join the swarm.

docker swarm join \
  --token  SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
  192.168.xx.xx:2377

However, when I run this command on either worker machine I receive the following error:
Error response from daemon: Timeout was reached before node 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.

I read that it is possible that it might take some time for a worker to join the swarm, but after an overnight wait, no go.

Before going to bed, I verified the correct ports were open on the manager node as listed in the guide referenced above.

I also verified the port was open on the manager machine from both workers
Connection to 192.168.xx.xx port 2377 [udp/*] succeeded!

Being that I saw the same results from two different machines trying to join the swarm, I’m lead to believe this is something on my manager machine. I tried turning the firewall off completely for troubleshooting purposes, but saw the same results.

After a lot of research, I’m not really sure what is going on. Any advice will be welcome.

Thanks in advance!

I can’t find it now, so maybe it changed, but as far as I know Docker Desktop supports only a single node swarm cluster, because the necessary ports are not available on your actual host. The ports you see in the required port list have to be available on the host, not just inside Docker Desktop’s virtual machine.

You could use socat to forward the necessary ports from the host into Docker Desktop.

https://hub.docker.com/r/alpine/socat

This image description mentions macOS, but I would expect the same requirement on Windows.

1 Like

Thanks for your reply.

It seems you are correct: Docker swarm mode on Docker Desktop - Stack Overflow.

I hadn’t considered that this wouldn’t work with desktop installations since I’m still able to use the cli and i had made all of the ports open on the host machine.