Docker Community Forums

Share and learn in the Docker community.

Docker swarm dns connection


(Danny7711) #1

Hey I need some help communicating between containers across nodes in swarm.

Cannot resolve service names on different swarm nodes

Run on manager:

docker network create -d overlay --attachable mynetwork

docker service create --replicas 3 --name my-web --constraint "node.role==manager" --network mynetwork nginx

docker service create --constraint="node.role==manager" --name my-busybox --network mynetwork busybox sleep 3000

inside busybox on manager node nslookup my-web succeeds and finds IP for my-web

docker service rm my-busybox

docker service create --constraint="node.role==worker" --name my-busybox --network mynetwork busybox sleep 3000

Run on worker:

inside busybox on worker node nslookup my-web fails to find IP for my-web

Note:

Any ideas?

Thanks