I have a problem with docker swarm. I have published a port of a container attached to an overlay network of my swarm but the port is only reachable from within each host of my swarm.
In fact, i cannot access the port from outside the swarm
I have 4 machines :
host 1 : 10.0.0.5 member of swarm
host 2 : 10.0.0.6 member of swarm
host 3 : 10.0.0.7 member of swarm
host 4 : 10.0.0.1 not member of swarm
and one container :
vault container exposing the TCP port 4200 ; Below the part of configuration of the docker-compose file
When i start my stack, docker create my container and an overlay network associated to it.
The result of the command docker stack services return
a**@alaska:~$ docker stack services test
ID NAME MODE REPLICAS IMAGE PORTS
rhjg9jc0guyy test_vault replicated 1/1 vault:1.4.2 *:30000->8200/tcp
When i run telnet 127.0.0.1 30000 on host1, host2 and host3, it return a success response, but i have a timeout when i run telnet 10.0.0.5 30000 from host4.
I have read the documentation of docker and it seems that my swarm will expose the port only on public IP adress. Is there a way to allow the exposure of the port of my container on a private IP adress ?
docker run is accessible from other host (v17 and v19)
docker service create on docker 17 is accessible from other host
docker service create on docker 19 is NOT accessible from other host
I have been running a stack on Docker version 17.05.0-ce, build 89658be for some time.
Due to a bug I have upgraded to Docker version 19.03.11, build 42e35e61f3 and found the exact same problem described by this thread, a stack that was previously working, is now no longer accessible outside of the host.
I have removed my own stack from the equation and simply use nginx as an example: docker run --publish published=8080,target=80 nginx is accessible from my jumphost
docker service create --name nginx --publish published=8080,target=80 nginx is not accessible from the jump host (but is accessible from on the host via curl 10.0.0.36:8080
I have tried to create a service with a published port on all “19.03” docker minor versions.
The service created is reachable on docker 19.03.04. But from 19.03.05, the service is not reachable.