January 2018
Intermediate to advanced
414 pages
10h 29m
English
We can list the instance of one service with the command:
docker service ps hello-service
This will output something like:
ID NAME IMAGE suqe3o61n38e hello-service.1 localhost:5000/hello:latestenhf89re1kz9 hello-service.2 localhost:5000/hello:latestsqmo44zoaqnc hello-service.3 localhost:5000/hello:latest
We can now open a shell session on those containers with the following command:
docker exec -it hello-service.2.enhf89re1kz9cieyvdgmnl9l1 /bin/sh
This will open a terminal to that Docker container, and we need to use the exit command to terminate it.
Finally, if we want to, we can delete a service with the following command:
docker service rm hello-service
With this last command, all service instances will be terminated, ...
Read now
Unlock full access