mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Docs changes for labels based on feedback
Signed-off-by: Darren Shepherd <darren@rancher.com>
This commit is contained in:
parent
5de1298f41
commit
03cea0ef23
3 changed files with 21 additions and 21 deletions
|
@ -129,11 +129,6 @@ Create a container
|
||||||
],
|
],
|
||||||
"Entrypoint": "",
|
"Entrypoint": "",
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
"Labels": {
|
|
||||||
"com.example.vendor": "Acme",
|
|
||||||
"com.example.license": "GPL",
|
|
||||||
"com.example.version": "1.0"
|
|
||||||
},
|
|
||||||
"Volumes": {
|
"Volumes": {
|
||||||
"/tmp": {}
|
"/tmp": {}
|
||||||
},
|
},
|
||||||
|
@ -194,8 +189,6 @@ Json Parameters:
|
||||||
- **OpenStdin** - Boolean value, opens stdin,
|
- **OpenStdin** - Boolean value, opens stdin,
|
||||||
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
|
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
|
||||||
- **Env** - A list of environment variables in the form of `VAR=value`
|
- **Env** - A list of environment variables in the form of `VAR=value`
|
||||||
- **Labels** - A map of labels and their values that will be added to the
|
|
||||||
container. It should be specified in the form `{"name":"value"[,"name2":"value2"]}`
|
|
||||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||||
- **Entrypoint** - Set the entrypoint for the container a a string or an array
|
- **Entrypoint** - Set the entrypoint for the container a a string or an array
|
||||||
of strings
|
of strings
|
||||||
|
@ -305,11 +298,6 @@ Return low-level information on the container `id`
|
||||||
"ExposedPorts": null,
|
"ExposedPorts": null,
|
||||||
"Hostname": "ba033ac44011",
|
"Hostname": "ba033ac44011",
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
"Labels": {
|
|
||||||
"com.example.vendor": "Acme",
|
|
||||||
"com.example.license": "GPL",
|
|
||||||
"com.example.version": "1.0"
|
|
||||||
},
|
|
||||||
"MacAddress": "",
|
"MacAddress": "",
|
||||||
"Memory": 0,
|
"Memory": 0,
|
||||||
"MemorySwap": 0,
|
"MemorySwap": 0,
|
||||||
|
@ -1181,11 +1169,6 @@ Return low-level information on the image `name`
|
||||||
"Cmd": ["/bin/bash"],
|
"Cmd": ["/bin/bash"],
|
||||||
"Dns": null,
|
"Dns": null,
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
"Labels": {
|
|
||||||
"com.example.vendor": "Acme",
|
|
||||||
"com.example.license": "GPL",
|
|
||||||
"com.example.version": "1.0"
|
|
||||||
},
|
|
||||||
"Volumes": null,
|
"Volumes": null,
|
||||||
"VolumesFrom": "",
|
"VolumesFrom": "",
|
||||||
"WorkingDir": ""
|
"WorkingDir": ""
|
||||||
|
|
|
@ -129,6 +129,11 @@ Create a container
|
||||||
],
|
],
|
||||||
"Entrypoint": "",
|
"Entrypoint": "",
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.vendor": "Acme",
|
||||||
|
"com.example.license": "GPL",
|
||||||
|
"com.example.version": "1.0"
|
||||||
|
},
|
||||||
"Volumes": {
|
"Volumes": {
|
||||||
"/tmp": {}
|
"/tmp": {}
|
||||||
},
|
},
|
||||||
|
@ -190,6 +195,8 @@ Json Parameters:
|
||||||
- **OpenStdin** - Boolean value, opens stdin,
|
- **OpenStdin** - Boolean value, opens stdin,
|
||||||
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
|
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
|
||||||
- **Env** - A list of environment variables in the form of `VAR=value`
|
- **Env** - A list of environment variables in the form of `VAR=value`
|
||||||
|
- **Labels** - A map of labels and their values that will be added to the
|
||||||
|
container. It should be specified in the form `{"name":"value"[,"name2":"value2"]}`
|
||||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||||
- **Entrypoint** - Set the entrypoint for the container a a string or an array
|
- **Entrypoint** - Set the entrypoint for the container a a string or an array
|
||||||
of strings
|
of strings
|
||||||
|
@ -302,6 +309,11 @@ Return low-level information on the container `id`
|
||||||
"ExposedPorts": null,
|
"ExposedPorts": null,
|
||||||
"Hostname": "ba033ac44011",
|
"Hostname": "ba033ac44011",
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.vendor": "Acme",
|
||||||
|
"com.example.license": "GPL",
|
||||||
|
"com.example.version": "1.0"
|
||||||
|
},
|
||||||
"MacAddress": "",
|
"MacAddress": "",
|
||||||
"Memory": 0,
|
"Memory": 0,
|
||||||
"MemorySwap": 0,
|
"MemorySwap": 0,
|
||||||
|
@ -1186,6 +1198,11 @@ Return low-level information on the image `name`
|
||||||
"Cmd": ["/bin/bash"],
|
"Cmd": ["/bin/bash"],
|
||||||
"Dns": null,
|
"Dns": null,
|
||||||
"Image": "ubuntu",
|
"Image": "ubuntu",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.vendor": "Acme",
|
||||||
|
"com.example.license": "GPL",
|
||||||
|
"com.example.version": "1.0"
|
||||||
|
},
|
||||||
"Volumes": null,
|
"Volumes": null,
|
||||||
"VolumesFrom": "",
|
"VolumesFrom": "",
|
||||||
"WorkingDir": ""
|
"WorkingDir": ""
|
||||||
|
|
|
@ -1840,21 +1840,21 @@ An example of a file passed with `--env-file`
|
||||||
This will create and run a new container with the container name being
|
This will create and run a new container with the container name being
|
||||||
`console`.
|
`console`.
|
||||||
|
|
||||||
$ sudo docker run -l my-label --env com.example.foo=bar ubuntu bash
|
$ sudo docker run -l my-label --label com.example.foo=bar ubuntu bash
|
||||||
|
|
||||||
This sets two labels on the container. Label "my-label" doesn't have a value
|
This sets two labels on the container. Label "my-label" doesn't have a value
|
||||||
specified and will default to "" (empty string) for its value. Both `-l` and
|
specified and will default to "" (empty string) for its value. Both `-l` and
|
||||||
`--env` can be repeated to add more labels. Label names are unique; if the same
|
`--label` can be repeated to add more labels. Label names are unique; if the same
|
||||||
label is specified multiple times, latter values overwrite the previous value.
|
label is specified multiple times, latter values overwrite the previous value.
|
||||||
|
|
||||||
Labels can also be loaded from a line delimited file of labels using the
|
Labels can also be loaded from a line delimited file of labels using the
|
||||||
`--label-file` flag. The example below will load labels from a file named `labels`
|
`--label-file` flag. The example below will load labels from a file named `labels`
|
||||||
in the current directory;
|
in the current directory;
|
||||||
|
|
||||||
$ sudo docker run --env-file ./labels ubuntu bash
|
$ sudo docker run --label-file ./labels ubuntu bash
|
||||||
|
|
||||||
The format of the labels-file is similar to that used for loading environment
|
The format of the labels-file is similar to that used for loading environment
|
||||||
variables (see `--env-file` above). An example of a file passed with `--env-file`;
|
variables (see `--label-file` above). An example of a file passed with `--label-file`;
|
||||||
|
|
||||||
$ cat ./labels
|
$ cat ./labels
|
||||||
com.example.label1="a label"
|
com.example.label1="a label"
|
||||||
|
|
Loading…
Add table
Reference in a new issue