Access nginx (80) in browser after deploy in swarm

I have swarm-master, and 2 swarm node (swarm1, swarm2)

I deploy nginx with port 80 inside swarm-master, and run well, i can see both nginx in swarm1 and swarm2


when i try to access from, got this refused to connect.

both using virtualbox

is there a missing setting in my side?


swarm doesn’t make the IP addresses of all swarm members somehow map to all containers. This is by design, as you might need to run two services that expose port 80. I would expect that you will be able to access a published port over the IP address of the host that is acting as the exit node for the network the container is attached to.

what happen if i run

docker run -d nginx

inside swarm-master? why swarm1 and swarm2 dont have daemon of nginx in both side?

I try both

docker run -d -e constraint:node==swarm1 nginx

docker run -d -e constraint:node==swarm1 --net=host --volume=/var/run/docker.sock:/tmp/docker.sock gliderlabs/registrator:latest consul://

i cant get any change in my swarm?

can help?

Docker Swarm, a cluster manager for Docker hosts exposes a pool of hosts as a single “virtual” host. What is