Skip to content

Docker swarm management commands

Deepak Narayana Rao edited this page Nov 13, 2017 · 2 revisions

Commands / Jenkins jobs

List nodes in swarm

This will list all nodes and their role (manager/worker)

docker node ls

List services running in swarm

docker service ls

Jenkins job: Docker_Swarm_Service_List

Get info of service in swarm

docker service ls | grep <service-name>
docker service ps <service-name> --no-trunc
docker service logs <service-name> --tail 200 -f

Jenkins job: Docker_Swarm_Service_Info, Parameter: docker_swarm_service_name

Restart service in swarm

Ref: https://stackoverflow.com/a/41897600/69362

docker service update <service-name> --force

Jenkins job: Docker_Swarm_Service_Restart, Parameter: docker_swarm_service_name

Scale service in swarm

docker service scale <service-name>=<number-of-replicas>

Troubleshooting

For troubleshooting docker swarm issues check Docker swarm troubleshooting

Clone this wiki locally