docker node ps
Description
List tasks running on one or more nodes, defaults to current node
Usage
docker node ps [OPTIONS] [NODE...]
Options
| Name, shorthand | Default | Description |
|---|---|---|
--filter, -f | Filter output based on conditions provided | |
--no-resolve | false | Do not map IDs to Names |
--no-trunc | false | Do not truncate output |
Parent command
| Command | Description |
|---|---|
| docker node | Manage Swarm nodes |
Related commands
| Command | Description |
|---|---|
| docker node demote | Demote one or more nodes from manager in the swarm |
| docker node inspect | Display detailed information on one or more nodes |
| docker node ls | List nodes in the swarm |
| docker node promote | Promote one or more nodes to manager in the swarm |
| docker node ps | List tasks running on one or more nodes, defaults to current node |
| docker node rm | Remove one or more nodes from the swarm |
| docker node update | Update a node |
Extended description
Lists all the tasks on a Node that Docker knows about. You can filter using the -f or --filter flag. Refer to the filtering section for more information about available filter options.
Examples
$ docker node ps swarm-manager1 NAME IMAGE NODE DESIRED STATE CURRENT STATE redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
Filtering
The filtering flag (-f or --filter) format is of “key=value”. If there is more than one filter, then pass multiple flags (e.g., --filter "foo=bar" --filter "bif=baz")
The currently supported filters are:
name
The name filter matches on all or part of a task’s name.
The following filter matches all tasks with a name containing the redis string.
$ docker node ps -f name=redis swarm-manager1 NAME IMAGE NODE DESIRED STATE CURRENT STATE redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
id
The id filter matches a task’s id.
$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1 NAME IMAGE NODE DESIRED STATE CURRENT STATE redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds
label
The label filter matches tasks based on the presence of a label alone or a label and a value.
The following filter matches tasks with the usage label regardless of its value.
$ docker node ps -f "label=usage" NAME IMAGE NODE DESIRED STATE CURRENT STATE redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes
desired-state
The desired-state filter can take the values running, shutdown, and accepted.
© 2017 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
https://docs.docker.com/v1.13/engine/reference/commandline/node_ps/