github.com/kobeld/docker@v1.12.0-rc1/docs/reference/commandline/node_tasks.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "node tasks"
     4  description = "The node tasks command description and usage"
     5  keywords = ["node, tasks"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  +++
     9  <![end-metadata]-->
    10  
    11  **Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes.
    12  
    13  # node tasks
    14  
    15      Usage:  docker node tasks [OPTIONS] NODE
    16  
    17      List tasks running on a node
    18  
    19      Options:
    20        -a, --all            Display all instances
    21        -f, --filter value   Filter output based on conditions provided
    22        --help           Print usage
    23        -n, --no-resolve     Do not map IDs to Names
    24  
    25  Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options.
    26  
    27  Example output:
    28  
    29      $ docker node tasks swarm-master
    30      ID                         NAME     SERVICE  IMAGE        DESIRED STATE  LAST STATE       NODE
    31      dx2g0fe3zsdb6y6q453f8dqw2  redis.1  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    32      f33pcf8lwhs4c1t4kq8szwzta  redis.4  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    33      5v26yzixl3one3ptjyqqbd0ro  redis.5  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    34      adcaphlhsfr30d47lby6walg6  redis.8  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    35      chancjvk9tex6768uzzacslq2  redis.9  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    36  
    37  
    38  ## Filtering
    39  
    40  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    41  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    42  
    43  The currently supported filters are:
    44  
    45  * name
    46  * id
    47  * label
    48  * desired_state
    49  
    50  ### name
    51  
    52  The `name` filter matches on all or part of a task's name.
    53  
    54  The following filter matches all tasks with a name containing the `redis` string.
    55  
    56      $ docker node tasks -f name=redis swarm-master
    57      ID                         NAME     SERVICE  IMAGE        DESIRED STATE  LAST STATE       NODE
    58      dx2g0fe3zsdb6y6q453f8dqw2  redis.1  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    59      f33pcf8lwhs4c1t4kq8szwzta  redis.4  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    60      5v26yzixl3one3ptjyqqbd0ro  redis.5  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    61      adcaphlhsfr30d47lby6walg6  redis.8  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    62      chancjvk9tex6768uzzacslq2  redis.9  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    63  
    64  
    65  ### id
    66  
    67  The `id` filter matches a task's id.
    68  
    69      $ docker node tasks -f id=f33pcf8lwhs4c1t4kq8szwzta swarm-master
    70      ID                         NAME     SERVICE  IMAGE        DESIRED STATE  LAST STATE       NODE
    71      f33pcf8lwhs4c1t4kq8szwzta  redis.4  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    72  
    73  
    74  #### label
    75  
    76  The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
    77  value.
    78  
    79  The following filter matches tasks with the `usage` label regardless of its value.
    80  
    81  ```bash
    82  $ docker node tasks -f "label=usage"
    83  ID                         NAME     SERVICE  IMAGE        DESIRED STATE  LAST STATE       NODE
    84  dx2g0fe3zsdb6y6q453f8dqw2  redis.1  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    85  f33pcf8lwhs4c1t4kq8szwzta  redis.4  redis    redis:3.0.6  RUNNING        RUNNING 2 hours  swarm-master
    86  ```
    87  
    88  
    89  ## Related information
    90  
    91  * [node inspect](node_inspect.md)
    92  * [node update](node_update.md)
    93  * [node ls](node_ls.md)
    94  * [node rm](node_rm.md)