Hi,
My container runs a TCP socket server which listens to commands on port 6000.
Now i launch this same container as a swarm service with multiple replicas.
Somehow, I want all the containers in the service to be able to receive the commands simultaneously at their internal port 6000, when I make a tcp connection from outside.
But when i connect to the host using :6000, only one container at any time receives the commands.
I created the swarm with 2 replicas:
docker service create
–replicas 2
–network mynet
–mount type=bind,source=/tmp/.X11-unix,destination=/tmp/.X11-unix
-p 6000:6000
–name service_nv2
–restart-condition=none
myContainerImage /home/command.sh
I see my 2 containers are launched correctly on the 2 hosts.
But only one of them gets my commands.