Commandes Linux : docker node ls

DOCKER NODE LS

Commande : docker node ls
Usage:	docker node ls [OPTIONS]

List nodes in the swarm

Aliases:
  ls, list

Options:
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print nodes using a Go template
  -q, --quiet           Only display IDs

 

Lister les nodes du swarm

$ docker node ls

Cette commande ne peut être exécutée que sur un manager du swarm.
ex :

$ docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
2tbkss0ywais935a56ejcsaj3 *   node1               Ready               Active              Leader              18.06.1-ce
pqyqmz0hs6y0yjmq93s5t64yh     node2               Ready               Active                                  18.06.1-ce
uof4dq49vyg81w6shkgsodjj6     node3               Ready               Active                                  18.06.1-ce
gzj3ho5iu91c5blamk4hpt5d6     node4               Ready               Active                                  18.06.1-ce

 

Lister les containers de tous les nodes du swarm

$ docker node ps $(docker node ls -q)

Cette commande ne peut être exécutée que sur un manager du swarm.
ex :

$ docker node ps $(docker node ls -q) | uniq
ID                  NAME                IMAGE                   NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
xulx09ta5erq         \_ vote.1          instavote/vote:latest   node1               Running             Running 3 minutes ago
9r8rovobe6kz         \_ vote.2          instavote/vote:latest   node2               Running             Running 3 minutes ago
kubdns26nfgn        vote.3              instavote/vote:latest   node3               Running             Running 3 minutes ago
1ul7pmfbx2f5         \_ vote.4          instavote/vote:latest   node1               Running             Running 3 minutes ago
js8q4ix0hkor         \_ vote.5          instavote/vote:latest   node2               Running             Running 3 minutes ago
p8g15xvh574k        vote.6              instavote/vote:latest   node3               Running             Running 3 minutes ago