Browse code

Add docs for container/image labels

Signed-off-by: Darren Shepherd <darren@rancher.com>

Darren Shepherd authored on 2015/01/23 05:47:10
Showing 3 changed files
... ...
@@ -83,10 +83,21 @@ to an image.  For example you could add data describing the content of an image.
83 83
 **New!**
84 84
 Docker client now hints potential proxies about connection hijacking using HTTP Upgrade headers.
85 85
 
86
+`POST /containers/create`
87
+
88
+**New!**
89
+You can set labels on container create describing the container.
90
+
91
+`GET /containers/json`
92
+
93
+**New!**
94
+This endpoint now returns the labels associated with each container (`Labels`).
95
+
86 96
 `GET /containers/(id)/json`
87 97
 
88 98
 **New!**
89 99
 This endpoint now returns the list current execs associated with the container (`ExecIDs`).
100
+This endpoint now returns the container labels (`Config.Labels`).
90 101
 
91 102
 `POST /containers/(id)/rename`
92 103
 
... ...
@@ -105,6 +116,12 @@ root filesystem as read only.
105 105
 **New!**
106 106
 This endpoint returns a live stream of a container's resource usage statistics.
107 107
 
108
+`GET /images/json`
109
+
110
+**New!**
111
+This endpoint now returns the labels associated with each image (`Labels`).
112
+
113
+
108 114
 ## v1.16
109 115
 
110 116
 ### Full Documentation
... ...
@@ -194,6 +194,7 @@ 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 list of labels that will applied in the form of `VAR=value`
197 198
 -   **Cmd** - Command to run specified as a string or an array of strings.
198 199
 -   **Entrypoint** - Set the entrypoint for the container a a string or an array
199 200
       of strings
... ...
@@ -303,6 +304,11 @@ Return low-level information on the container `id`
303 303
 			"ExposedPorts": null,
304 304
 			"Hostname": "ba033ac44011",
305 305
 			"Image": "ubuntu",
306
+                        "Labels": {
307
+                                "Vendor": "Acme",
308
+                                "License": "GPL",
309
+                                "Version": "1.0"
310
+                        },
306 311
 			"MacAddress": "",
307 312
 			"Memory": 0,
308 313
 			"MemorySwap": 0,
... ...
@@ -1174,7 +1180,11 @@ Return low-level information on the image `name`
1174 1174
                              "Cmd": ["/bin/bash"],
1175 1175
                              "Dns": null,
1176 1176
                              "Image": "ubuntu",
1177
-                             "Labels": null,
1177
+                             "Labels": {
1178
+                                    "Vendor": "Acme",
1179
+                                    "License": "GPL",
1180
+                                    "Version": "1.0"
1181
+                             },
1178 1182
                              "Volumes": null,
1179 1183
                              "VolumesFrom": "",
1180 1184
                              "WorkingDir": ""
... ...
@@ -1662,6 +1662,8 @@ removed before the image is removed.
1662 1662
       --link=[]                  Add link to another container
1663 1663
       --lxc-conf=[]              Add custom lxc options
1664 1664
       -m, --memory=""            Memory limit
1665
+      -l, --label=[]             Set meta data on a container, for example com.example.key=value
1666
+      -label-file=[]             Read in a line delimited file of labels
1665 1667
       --mac-address=""           Container MAC address (e.g. 92:d0:c6:0a:29:33)
1666 1668
       --memory-swap=""           Total memory (memory + swap), '-1' to disable swap
1667 1669
       --name=""                  Assign a name to the container