A service is a group of containers with the same
It makes it easy to scale your application (i.e. you just increase the number of containers in the service).
To create a new service use
docker service create
Note – this must be run on a Swarm manager.
docker service create -d --name pinger --replicas 2 --network ubernet alpine sleep 1d
docker service ls
Check which nodes they’re on with:
docker service ps pinger
and, switching to that node, we can check the network with:
docker network inspect ubernet
which shows the service under
Switching to the second replica we should see the task by doing a:
docker container ls