185k views
5 votes
What is the command that lists the services running in your swarm cluster?

A) docker service ps

B) docker swarm services

C) docker swarm list

D) docker service ls

1 Answer

7 votes

Final answer:

The correct command to list services in a Docker swarm cluster is 'docker service ls'. It provides details like service ID, name, and replicas.

Step-by-step explanation:

To list the services running in your Docker swarm cluster, the correct command to use is docker service ls. This will provide you with a list of all the services that are currently active within your swarm. The output includes details such as the ID, name, mode, replicas, and image of the services that are running. If you want to see the tasks associated with a specific service, you can use the command docker service ps followed by the service name.

User Paul Nearney
by
7.4k points