1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

update 3 old docs about secret in docs/reference/commandline/

Signed-off-by: uhayate <uhayate.gong@daocloud.io>
This commit is contained in:
uhayate 2017-03-24 16:34:03 +08:00
parent 65068ea4c0
commit 208653e712
3 changed files with 34 additions and 30 deletions

View file

@ -36,11 +36,13 @@ command on a manager node.
```bash ```bash
$ echo <secret> | docker secret create my_secret - $ echo <secret> | docker secret create my_secret -
mhv17xfe3gh6xc4rij5orpfds
onakdyv307se2tl7nl20anokv
$ docker secret ls $ docker secret ls
ID NAME CREATED UPDATED SIZE
mhv17xfe3gh6xc4rij5orpfds my_secret 2016-10-27 23:25:43.909181089 +0000 UTC 2016-10-27 23:25:43.909181089 +0000 UTC 1679 ID NAME CREATED UPDATED
onakdyv307se2tl7nl20anokv my_secret 6 seconds ago 6 seconds ago
``` ```
### Create a secret with a file ### Create a secret with a file
@ -48,22 +50,22 @@ mhv17xfe3gh6xc4rij5orpfds my_secret 2016-10-27 23:25:43.90918108
```bash ```bash
$ docker secret create my_secret ./secret.json $ docker secret create my_secret ./secret.json
mhv17xfe3gh6xc4rij5orpfds dg426haahpi5ezmkkj5kyl3sn
$ docker secret ls $ docker secret ls
ID NAME CREATED UPDATED SIZE ID NAME CREATED UPDATED
mhv17xfe3gh6xc4rij5orpfds my_secret 2016-10-27 23:25:43.909181089 +0000 UTC 2016-10-27 23:25:43.909181089 +0000 UTC 1679 dg426haahpi5ezmkkj5kyl3sn my_secret 7 seconds ago 7 seconds ago
``` ```
### Create a secret with labels ### Create a secret with labels
```bash ```bash
$ docker secret create --label env=dev \ $ docker secret create --label env=dev \
--label rev=20161102 \ --label rev=20170324 \
my_secret ./secret.json my_secret ./secret.json
jtn7g6aukl5ky7nr9gvwafoxh eo7jnzguqgtpdah3cm5srfb97
``` ```
```none ```none
@ -71,22 +73,19 @@ $ docker secret inspect my_secret
[ [
{ {
"ID": "jtn7g6aukl5ky7nr9gvwafoxh", "ID": "eo7jnzguqgtpdah3cm5srfb97",
"Version": { "Version": {
"Index": 541 "Index": 17
}, },
"CreatedAt": "2016-11-03T20:54:12.924766548Z", "CreatedAt": "2017-03-24T08:15:09.735271783Z",
"UpdatedAt": "2016-11-03T20:54:12.924766548Z", "UpdatedAt": "2017-03-24T08:15:09.735271783Z",
"Spec": { "Spec": {
"Name": "my_secret", "Name": "my_secret",
"Labels": { "Labels": {
"env": "dev", "env": "dev",
"rev": "20161102" "rev": "20170324"
}, }
"Data": null }
},
"Digest": "sha256:4212a44b14e94154359569333d3fc6a80f6b9959dfdaff26412f4b2796b1f387",
"SecretSize": 1679
} }
] ]
``` ```

View file

@ -46,8 +46,9 @@ For example, given the following secret:
```bash ```bash
$ docker secret ls $ docker secret ls
ID NAME CREATED UPDATED 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 eo7jnzguqgtpdah3cm5srfb97 my_secret 3 minutes ago 3 minutes ago
``` ```
```none ```none
@ -55,14 +56,18 @@ $ docker secret inspect secret.json
[ [
{ {
"ID": "mhv17xfe3gh6xc4rij5orpfds", "ID": "eo7jnzguqgtpdah3cm5srfb97",
"Version": { "Version": {
"Index": 1198 "Index": 17
}, },
"CreatedAt": "2016-10-27T23:25:43.909181089Z", "CreatedAt": "2017-03-24T08:15:09.735271783Z",
"UpdatedAt": "2016-10-27T23:25:43.909181089Z", "UpdatedAt": "2017-03-24T08:15:09.735271783Z",
"Spec": { "Spec": {
"Name": "secret.json" "Name": "my_secret",
"Labels": {
"env": "dev",
"rev": "20170324"
}
} }
} }
] ]
@ -75,9 +80,9 @@ secret. The following example command outputs the creation time of the
secret. secret.
```bash ```bash
$ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds $ docker secret inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97
2016-10-27 23:25:43.909181089 +0000 UTC 2017-03-24 08:15:09.735271783 +0000 UTC
``` ```

View file

@ -37,7 +37,7 @@ Run this command on a manager node to list the secrets in the swarm.
$ docker secret ls $ docker secret ls
ID NAME CREATED UPDATED 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 eo7jnzguqgtpdah3cm5srfb97 my_secret 11 minutes ago 11 minutes ago
``` ```
## Related commands ## Related commands