Signed-off-by: Darren Shepherd <darren@rancher.com>
| ... | ... |
@@ -129,11 +129,6 @@ Create a container |
| 129 | 129 |
], |
| 130 | 130 |
"Entrypoint": "", |
| 131 | 131 |
"Image": "ubuntu", |
| 132 |
- "Labels": {
|
|
| 133 |
- "com.example.vendor": "Acme", |
|
| 134 |
- "com.example.license": "GPL", |
|
| 135 |
- "com.example.version": "1.0" |
|
| 136 |
- }, |
|
| 137 | 132 |
"Volumes": {
|
| 138 | 133 |
"/tmp": {}
|
| 139 | 134 |
}, |
| ... | ... |
@@ -194,8 +189,6 @@ Json Parameters: |
| 194 | 194 |
- **OpenStdin** - Boolean value, opens stdin, |
| 195 | 195 |
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects. |
| 196 | 196 |
- **Env** - A list of environment variables in the form of `VAR=value` |
| 197 |
-- **Labels** - A map of labels and their values that will be added to the |
|
| 198 |
- container. It should be specified in the form `{"name":"value"[,"name2":"value2"]}`
|
|
| 199 | 197 |
- **Cmd** - Command to run specified as a string or an array of strings. |
| 200 | 198 |
- **Entrypoint** - Set the entrypoint for the container a a string or an array |
| 201 | 199 |
of strings |
| ... | ... |
@@ -305,11 +298,6 @@ Return low-level information on the container `id` |
| 305 | 305 |
"ExposedPorts": null, |
| 306 | 306 |
"Hostname": "ba033ac44011", |
| 307 | 307 |
"Image": "ubuntu", |
| 308 |
- "Labels": {
|
|
| 309 |
- "com.example.vendor": "Acme", |
|
| 310 |
- "com.example.license": "GPL", |
|
| 311 |
- "com.example.version": "1.0" |
|
| 312 |
- }, |
|
| 313 | 308 |
"MacAddress": "", |
| 314 | 309 |
"Memory": 0, |
| 315 | 310 |
"MemorySwap": 0, |
| ... | ... |
@@ -1181,11 +1169,6 @@ Return low-level information on the image `name` |
| 1181 | 1181 |
"Cmd": ["/bin/bash"], |
| 1182 | 1182 |
"Dns": null, |
| 1183 | 1183 |
"Image": "ubuntu", |
| 1184 |
- "Labels": {
|
|
| 1185 |
- "com.example.vendor": "Acme", |
|
| 1186 |
- "com.example.license": "GPL", |
|
| 1187 |
- "com.example.version": "1.0" |
|
| 1188 |
- }, |
|
| 1189 | 1184 |
"Volumes": null, |
| 1190 | 1185 |
"VolumesFrom": "", |
| 1191 | 1186 |
"WorkingDir": "" |
| ... | ... |
@@ -129,6 +129,11 @@ Create a container |
| 129 | 129 |
], |
| 130 | 130 |
"Entrypoint": "", |
| 131 | 131 |
"Image": "ubuntu", |
| 132 |
+ "Labels": {
|
|
| 133 |
+ "com.example.vendor": "Acme", |
|
| 134 |
+ "com.example.license": "GPL", |
|
| 135 |
+ "com.example.version": "1.0" |
|
| 136 |
+ }, |
|
| 132 | 137 |
"Volumes": {
|
| 133 | 138 |
"/tmp": {}
|
| 134 | 139 |
}, |
| ... | ... |
@@ -190,6 +195,8 @@ Json Parameters: |
| 190 | 190 |
- **OpenStdin** - Boolean value, opens stdin, |
| 191 | 191 |
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects. |
| 192 | 192 |
- **Env** - A list of environment variables in the form of `VAR=value` |
| 193 |
+- **Labels** - A map of labels and their values that will be added to the |
|
| 194 |
+ container. It should be specified in the form `{"name":"value"[,"name2":"value2"]}`
|
|
| 193 | 195 |
- **Cmd** - Command to run specified as a string or an array of strings. |
| 194 | 196 |
- **Entrypoint** - Set the entrypoint for the container a a string or an array |
| 195 | 197 |
of strings |
| ... | ... |
@@ -302,6 +309,11 @@ Return low-level information on the container `id` |
| 302 | 302 |
"ExposedPorts": null, |
| 303 | 303 |
"Hostname": "ba033ac44011", |
| 304 | 304 |
"Image": "ubuntu", |
| 305 |
+ "Labels": {
|
|
| 306 |
+ "com.example.vendor": "Acme", |
|
| 307 |
+ "com.example.license": "GPL", |
|
| 308 |
+ "com.example.version": "1.0" |
|
| 309 |
+ }, |
|
| 305 | 310 |
"MacAddress": "", |
| 306 | 311 |
"Memory": 0, |
| 307 | 312 |
"MemorySwap": 0, |
| ... | ... |
@@ -1186,6 +1198,11 @@ Return low-level information on the image `name` |
| 1186 | 1186 |
"Cmd": ["/bin/bash"], |
| 1187 | 1187 |
"Dns": null, |
| 1188 | 1188 |
"Image": "ubuntu", |
| 1189 |
+ "Labels": {
|
|
| 1190 |
+ "com.example.vendor": "Acme", |
|
| 1191 |
+ "com.example.license": "GPL", |
|
| 1192 |
+ "com.example.version": "1.0" |
|
| 1193 |
+ }, |
|
| 1189 | 1194 |
"Volumes": null, |
| 1190 | 1195 |
"VolumesFrom": "", |
| 1191 | 1196 |
"WorkingDir": "" |
| ... | ... |
@@ -1840,21 +1840,21 @@ An example of a file passed with `--env-file` |
| 1840 | 1840 |
This will create and run a new container with the container name being |
| 1841 | 1841 |
`console`. |
| 1842 | 1842 |
|
| 1843 |
- $ sudo docker run -l my-label --env com.example.foo=bar ubuntu bash |
|
| 1843 |
+ $ sudo docker run -l my-label --label com.example.foo=bar ubuntu bash |
|
| 1844 | 1844 |
|
| 1845 | 1845 |
This sets two labels on the container. Label "my-label" doesn't have a value |
| 1846 | 1846 |
specified and will default to "" (empty string) for its value. Both `-l` and |
| 1847 |
-`--env` can be repeated to add more labels. Label names are unique; if the same |
|
| 1847 |
+`--label` can be repeated to add more labels. Label names are unique; if the same |
|
| 1848 | 1848 |
label is specified multiple times, latter values overwrite the previous value. |
| 1849 | 1849 |
|
| 1850 | 1850 |
Labels can also be loaded from a line delimited file of labels using the |
| 1851 | 1851 |
`--label-file` flag. The example below will load labels from a file named `labels` |
| 1852 | 1852 |
in the current directory; |
| 1853 | 1853 |
|
| 1854 |
- $ sudo docker run --env-file ./labels ubuntu bash |
|
| 1854 |
+ $ sudo docker run --label-file ./labels ubuntu bash |
|
| 1855 | 1855 |
|
| 1856 | 1856 |
The format of the labels-file is similar to that used for loading environment |
| 1857 |
-variables (see `--env-file` above). An example of a file passed with `--env-file`; |
|
| 1857 |
+variables (see `--label-file` above). An example of a file passed with `--label-file`; |
|
| 1858 | 1858 |
|
| 1859 | 1859 |
$ cat ./labels |
| 1860 | 1860 |
com.example.label1="a label" |