mirror of
https://github.com/docker/docs.git
synced 2026-03-28 14:58:53 +07:00
* Add Netlify build script * Pull 'edge' stuff from master for now * Add env-regex logging opt (#2688) * Update Dockerfile to pull from 17.05 branch * Update YAML files from 17.05.x branch * Add scaffolding for 17.05 content * Document highlights for 17.05 * Add v1.29 API * Document multi-stage builds
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
command: docker secret inspect
|
|
short: Display detailed information on one or more secrets
|
|
long: |-
|
|
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](http://golang.org/pkg/text/template/) package
|
|
describes all the details of the format.
|
|
|
|
For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
|
|
usage: docker secret inspect [OPTIONS] SECRET [SECRET...]
|
|
pname: docker secret
|
|
plink: docker_secret.yaml
|
|
options:
|
|
- option: format
|
|
shorthand: f
|
|
description: Format the output using the given Go template
|
|
examples: |-
|
|
### Inspect a secret by name or ID
|
|
|
|
You can inspect a secret, either by its *name*, or *ID*
|
|
|
|
For example, given the following secret:
|
|
|
|
```bash
|
|
$ docker secret ls
|
|
|
|
ID NAME CREATED UPDATED
|
|
eo7jnzguqgtpdah3cm5srfb97 my_secret 3 minutes ago 3 minutes ago
|
|
```
|
|
|
|
```none
|
|
$ docker secret inspect secret.json
|
|
|
|
[
|
|
{
|
|
"ID": "eo7jnzguqgtpdah3cm5srfb97",
|
|
"Version": {
|
|
"Index": 17
|
|
},
|
|
"CreatedAt": "2017-03-24T08:15:09.735271783Z",
|
|
"UpdatedAt": "2017-03-24T08:15:09.735271783Z",
|
|
"Spec": {
|
|
"Name": "my_secret",
|
|
"Labels": {
|
|
"env": "dev",
|
|
"rev": "20170324"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
```
|
|
|
|
### Formatting
|
|
|
|
You can use the --format option to obtain specific information about a
|
|
secret. The following example command outputs the creation time of the
|
|
secret.
|
|
|
|
```bash
|
|
$ docker secret inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
|
|
|
|
2017-03-24 08:15:09.735271783 +0000 UTC
|
|
```
|
|
|