1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/docs/reference/commandline/secret_inspect.md
cyli fe127b7eae Update docs to reflect no longer displaying secret digest or size.
Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-11-22 18:18:56 -05:00

2.3 KiB

title description keywords
secret inspect The secret inspect command description and usage
secret, inspect

secret inspect

Usage:  docker secret inspect [OPTIONS] SECRET [SECRET...]

Display detailed information on one or more secrets

Options:
  -f, --format string   Format the output using the given Go template
      --help            Print usage

Inspects the specified secret. This command has to be run targeting a manager node.

By default, this renders all results in a JSON array. If a format is specified, the given template will be executed for each result.

Go's text/template package describes all the details of the format.

Examples

Inspecting a secret by name or ID

You can inspect a secret, either by its name, or ID

For example, given the following secret:

$ docker secret ls
ID                          NAME                    CREATED                                   UPDATED
mhv17xfe3gh6xc4rij5orpfds   secret.json             2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC
$ docker secret inspect secret.json
[
    {
        "ID": "mhv17xfe3gh6xc4rij5orpfds",
            "Version": {
            "Index": 1198
        },
        "CreatedAt": "2016-10-27T23:25:43.909181089Z",
        "UpdatedAt": "2016-10-27T23:25:43.909181089Z",
        "Spec": {
            "Name": "secret.json"
        }
    }
]

Formatting secret output

You can use the --format option to obtain specific information about a secret. The following example command outputs the creation time of the secret.

$ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds
2016-10-27 23:25:43.909181089 +0000 UTC
{% endraw %}```


## Related information

* [secret create](secret_create.md)
* [secret ls](secret_ls.md)
* [secret rm](secret_rm.md)