github.com/fabiokung/docker@v0.11.2-0.20170222101415-4534dcd49497/docs/reference/commandline/secret_inspect.md (about)

     1  ---
     2  title: "secret inspect"
     3  description: "The secret inspect command description and usage"
     4  keywords: ["secret, inspect"]
     5  ---
     6  
     7  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # secret inspect
    17  
    18  ```Markdown
    19  Usage:  docker secret inspect [OPTIONS] SECRET [SECRET...]
    20  
    21  Display detailed information on one or more secrets
    22  
    23  Options:
    24    -f, --format string   Format the output using the given Go template
    25        --help            Print usage
    26  ```
    27  
    28  ## Description
    29  
    30  Inspects the specified secret. This command has to be run targeting a manager
    31  node.
    32  
    33  By default, this renders all results in a JSON array. If a format is specified,
    34  the given template will be executed for each result.
    35  
    36  Go's [text/template](http://golang.org/pkg/text/template/) package
    37  describes all the details of the format.
    38  
    39  ## Examples
    40  
    41  ### Inspect a secret by name or ID
    42  
    43  You can inspect a secret, either by its *name*, or *ID*
    44  
    45  For example, given the following secret:
    46  
    47  ```bash
    48  $ docker secret ls
    49  ID                          NAME                    CREATED                                   UPDATED
    50  mhv17xfe3gh6xc4rij5orpfds   secret.json             2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC
    51  ```
    52  
    53  ```none
    54  $ docker secret inspect secret.json
    55  
    56  [
    57      {
    58          "ID": "mhv17xfe3gh6xc4rij5orpfds",
    59              "Version": {
    60              "Index": 1198
    61          },
    62          "CreatedAt": "2016-10-27T23:25:43.909181089Z",
    63          "UpdatedAt": "2016-10-27T23:25:43.909181089Z",
    64          "Spec": {
    65              "Name": "secret.json"
    66          }
    67      }
    68  ]
    69  ```
    70  
    71  ### Formatting
    72  
    73  You can use the --format option to obtain specific information about a
    74  secret. The following example command outputs the creation time of the
    75  secret.
    76  
    77  ```bash
    78  {% raw %}
    79  $ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds
    80  
    81  2016-10-27 23:25:43.909181089 +0000 UTC
    82  {% endraw %}
    83  ```
    84  
    85  
    86  ## Related commands
    87  
    88  * [secret create](secret_create.md)
    89  * [secret ls](secret_ls.md)
    90  * [secret rm](secret_rm.md)