I have docker swarm mode set up with 3 ubuntu 16.04 machines with vagrant. I don't think mesh routing is working at all.
If I set up a service like
docker service create --name helloworld --replicas 1 -p 8888:80 nginx
I can see my service with
docker service ls
ID NAME REPLICAS IMAGE COMMAND
evbp2spkjn50 helloworld 1/1 nginx
I can curl to the ip of the machine that the actual container is running on:
curl 172.28.100.101:8888
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
....
But if I go to any other machine in the swarm, I am not routed properly:
curl 172.28.100.102:8888
curl: (7) Failed to connect to 172.28.100.102 port 8888: Connection refused
Now, if I scale the service such that a container is running on all of the machines like this:
docker service scale helloworld=3
helloworld scaled to 3
All of a sudden I can curl to it.
curl 172.28.100.102:8888
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
....
All ports are open between these machines (they are set up with vm.network :private_network, :ip => "172.28.100.10X", :netmask => "255.255.0.0"
in vagrant).
I have tried this with a dedicated network with no change.
docker --version
Docker version 1.12.1, build 23cf638