github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/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/cli GitHub
     8       repository at https://github.com/docker/cli/. 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  For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
    40  
    41  ## Examples
    42  
    43  ### Inspect a secret by name or ID
    44  
    45  You can inspect a secret, either by its *name*, or *ID*
    46  
    47  For example, given the following secret:
    48  
    49  ```bash
    50  $ docker secret ls
    51  
    52  ID                          NAME                CREATED             UPDATED
    53  eo7jnzguqgtpdah3cm5srfb97   my_secret           3 minutes ago       3 minutes ago
    54  ```
    55  
    56  ```none
    57  $ docker secret inspect secret.json
    58  
    59  [
    60      {
    61          "ID": "eo7jnzguqgtpdah3cm5srfb97",
    62          "Version": {
    63              "Index": 17
    64          },
    65          "CreatedAt": "2017-03-24T08:15:09.735271783Z",
    66          "UpdatedAt": "2017-03-24T08:15:09.735271783Z",
    67          "Spec": {
    68              "Name": "my_secret",
    69              "Labels": {
    70                  "env": "dev",
    71                  "rev": "20170324"
    72              }
    73          }
    74      }
    75  ]
    76  ```
    77  
    78  ### Formatting
    79  
    80  You can use the --format option to obtain specific information about a
    81  secret. The following example command outputs the creation time of the
    82  secret.
    83  
    84  ```bash
    85  $ docker secret inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
    86  
    87  2017-03-24 08:15:09.735271783 +0000 UTC
    88  ```
    89  
    90  
    91  ## Related commands
    92  
    93  * [secret create](secret_create.md)
    94  * [secret ls](secret_ls.md)
    95  * [secret rm](secret_rm.md)