github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/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  # secret inspect
     8  
     9  ```Markdown
    10  Usage:  docker secret inspect [OPTIONS] SECRET [SECRET...]
    11  
    12  Display detailed information on one or more secrets
    13  
    14  Options:
    15    -f, --format string   Format the output using the given Go template
    16        --help            Print usage
    17  ```
    18  
    19  ## Description
    20  
    21  Inspects the specified secret.
    22  
    23  By default, this renders all results in a JSON array. If a format is specified,
    24  the given template will be executed for each result.
    25  
    26  Go's [text/template](http://golang.org/pkg/text/template/) package
    27  describes all the details of the format.
    28  
    29  For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
    30  
    31  > **Note**
    32  >
    33  > This is a cluster management command, and must be executed on a swarm
    34  > manager node. To learn about managers and workers, refer to the
    35  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    36  > documentation.
    37  
    38  ## Examples
    39  
    40  ### Inspect 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  
    49  ID                          NAME                CREATED             UPDATED
    50  eo7jnzguqgtpdah3cm5srfb97   my_secret           3 minutes ago       3 minutes ago
    51  ```
    52  
    53  ```bash
    54  $ docker secret inspect secret.json
    55  ```
    56  
    57  The output is in JSON format, for example:
    58  
    59  ```json
    60  [
    61    {
    62      "ID": "eo7jnzguqgtpdah3cm5srfb97",
    63      "Version": {
    64        "Index": 17
    65      },
    66      "CreatedAt": "2017-03-24T08:15:09.735271783Z",
    67      "UpdatedAt": "2017-03-24T08:15:09.735271783Z",
    68      "Spec": {
    69        "Name": "my_secret",
    70        "Labels": {
    71          "env": "dev",
    72          "rev": "20170324"
    73        }
    74      }
    75    }
    76  ]
    77  ```
    78  
    79  ### Formatting
    80  
    81  You can use the --format option to obtain specific information about a
    82  secret. The following example command outputs the creation time of the
    83  secret.
    84  
    85  ```bash
    86  $ docker secret inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
    87  
    88  2017-03-24 08:15:09.735271783 +0000 UTC
    89  ```
    90  
    91  
    92  ## Related commands
    93  
    94  * [secret create](secret_create.md)
    95  * [secret ls](secret_ls.md)
    96  * [secret rm](secret_rm.md)