github.com/olljanat/moby@v1.13.1/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  
    29  Inspects the specified secret. This command has to be run targeting a manager
    30  node.
    31  
    32  By default, this renders all results in a JSON array. If a format is specified,
    33  the given template will be executed for each result.
    34  
    35  Go's [text/template](http://golang.org/pkg/text/template/) package
    36  describes all the details of the format.
    37  
    38  ## Examples
    39  
    40  ### Inspecting a secret by name or ID
    41  
    42  You can inspect a secret, either by its *name*, or *ID*
    43  
    44  For example, given the following secret:
    45  
    46  ```bash
    47  $ docker secret ls
    48  ID                          NAME                    CREATED                                   UPDATED
    49  mhv17xfe3gh6xc4rij5orpfds   secret.json             2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC
    50  ```
    51  
    52  ```bash
    53  $ docker secret inspect secret.json
    54  [
    55      {
    56          "ID": "mhv17xfe3gh6xc4rij5orpfds",
    57              "Version": {
    58              "Index": 1198
    59          },
    60          "CreatedAt": "2016-10-27T23:25:43.909181089Z",
    61          "UpdatedAt": "2016-10-27T23:25:43.909181089Z",
    62          "Spec": {
    63              "Name": "secret.json"
    64          }
    65      }
    66  ]
    67  ```
    68  
    69  ### Formatting secret output
    70  
    71  You can use the --format option to obtain specific information about a
    72  secret. The following example command outputs the creation time of the
    73  secret.
    74  
    75  ```bash{% raw %}
    76  $ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds
    77  2016-10-27 23:25:43.909181089 +0000 UTC
    78  {% endraw %}```
    79  
    80  
    81  ## Related information
    82  
    83  * [secret create](secret_create.md)
    84  * [secret ls](secret_ls.md)
    85  * [secret rm](secret_rm.md)