DCA · Question #130
Will this command list all nodes in a swarm cluster from the command line? Solution: `docker Is -a'
The correct answer is A. Yes. Assuming 'Is' is a typo for 'ls' and implicitly referring to docker node ls, this command would list all nodes in a Docker Swarm cluster.
Question
Will this command list all nodes in a swarm cluster from the command line? Solution: `docker Is -a'
Options
- AYes
- BNo
How the community answered
(21 responses)- A86% (18)
- B14% (3)
Why each option
Assuming 'Is' is a typo for 'ls' and implicitly referring to `docker node ls`, this command would list all nodes in a Docker Swarm cluster.
If 'Is' is interpreted as a typo for `ls`, and `docker ls` is understood to implicitly refer to `docker node ls` in the context of listing Swarm entities, then `docker node ls` successfully lists all nodes in a Docker Swarm, making the statement true under this interpretation. The `-a` flag is not typically used with `docker node ls` but doesn't prevent it from listing all nodes.
Concept tested: Docker Swarm node listing command (with typo interpretation)
Source: https://docs.docker.com/engine/reference/commandline/node_ls/
Topics
Community Discussion
No community discussion yet for this question.