I worked with https://labs.play-with-docker.com.
I created a new service in one of the managers (not the leader):
docker service create --name example nginx
When I ran:
docker container ls
It didn't show me the containers:
But when I ran the same command on the manager leader node, it did:
Any explanation why is that ?
You have created a service that is replicated only once (one container), if you want a global service (a container in each VM) you have to add --mode global
flag to you docker service create
command, by the way you take a look at --replicas
flag too : https://docs.docker.com/engine/swarm/services/