Commandes Linux : docker node ps

DOCKER NODE PS

Commande : docker node ps
Usage:	docker node ps [OPTIONS] [NODE...]

List tasks running on one or more nodes, defaults to current node

Options:
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print tasks using a Go template
      --no-resolve      Do not map IDs to Names
      --no-trunc        Do not truncate output
  -q, --quiet           Only display task IDs

 

Afficher la liste des tâches exécutées sur un ou plusieurs nodes

$ docker node ps [OPTIONS] [node|self...]

Si le node n’est pas spécifié, la requête est effectuée sur le node courant (self).
ex :

$ docker node ps node2
ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
pecu29d1qn4y        redis.3             redis:3.0.6         node2               Running             Running 9 minutes ago
815xpfkqmflk        redis.5             redis:3.0.6         node2               Running             Running 9 minutes ago
$ docker node ps -f name=redis node3
ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
qcyyv5yzd9to        redis.1             redis:3.0.6         node3               Running             Running 9 minutes ago
gz7vp0fylq34        redis.4             redis:3.0.6         node3               Running             Running 9 minutes ago
$ docker node ps --format "{{.Name}}: {{.Image}}" self
redis.2: redis:3.0.6

 

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

 

Fermer le menu
%d blogueurs aiment cette page :