Can't see container for 2nd service

Expected behavior

When I launch a second service, to see the container(s) for that service

Actual behavior

Only the container for the first service is visible

Additional Information

1 worker and 1 manager with beta5

I just started playing with this yesterday and I was able to get a service using nginx like in the examples just fine. I wanted to try to launch a second service and test the service discovery between containers and while it would show me a second service created and running when I would “docker service ls” the containers for that service are never listed with “docker ps”

Steps to reproduce the behavior

  1. docker service create --name redis redis
  2. docker service create --name nginx nginx
  3. ‘docker ps’ lists a container for redis but none for nginx
  4. ‘docker service ps nginx’ lists a running node but I can’t connect to it

I don’t really understand what is going on.

I see now that one service’s containers are running on the manager and the other’s is running on the worker node… but it still seems a problem to ping one from the other.

To connect to other nodes, you have to use -H <node-host-name> with docker commands you want to run with containers on other nodes.

If you want the containers to be able to communicate, you have to use a network: