Просмотр исходного кода

Add docs for container/image labels

Signed-off-by: Darren Shepherd <darren@rancher.com>
Darren Shepherd 10 лет назад
Родитель
Сommit
389eee1084

+ 17 - 0
docs/sources/reference/api/docker_remote_api.md

@@ -83,10 +83,21 @@ to an image.  For example you could add data describing the content of an image.
 **New!**
 Docker client now hints potential proxies about connection hijacking using HTTP Upgrade headers.
 
+`POST /containers/create`
+
+**New!**
+You can set labels on container create describing the container.
+
+`GET /containers/json`
+
+**New!**
+This endpoint now returns the labels associated with each container (`Labels`).
+
 `GET /containers/(id)/json`
 
 **New!**
 This endpoint now returns the list current execs associated with the container (`ExecIDs`).
+This endpoint now returns the container labels (`Config.Labels`).
 
 `POST /containers/(id)/rename`
 
@@ -105,6 +116,12 @@ root filesystem as read only.
 **New!**
 This endpoint returns a live stream of a container's resource usage statistics.
 
+`GET /images/json`
+
+**New!**
+This endpoint now returns the labels associated with each image (`Labels`).
+
+
 ## v1.16
 
 ### Full Documentation

+ 11 - 1
docs/sources/reference/api/docker_remote_api_v1.17.md

@@ -194,6 +194,7 @@ Json Parameters:
 -   **OpenStdin** - Boolean value, opens stdin,
 -   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
 -   **Env** - A list of environment variables in the form of `VAR=value`
+-   **Labels** - A list of labels that will applied in the form of `VAR=value`
 -   **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
       of strings
@@ -303,6 +304,11 @@ Return low-level information on the container `id`
 			"ExposedPorts": null,
 			"Hostname": "ba033ac44011",
 			"Image": "ubuntu",
+                        "Labels": {
+                                "Vendor": "Acme",
+                                "License": "GPL",
+                                "Version": "1.0"
+                        },
 			"MacAddress": "",
 			"Memory": 0,
 			"MemorySwap": 0,
@@ -1174,7 +1180,11 @@ Return low-level information on the image `name`
                              "Cmd": ["/bin/bash"],
                              "Dns": null,
                              "Image": "ubuntu",
-                             "Labels": null,
+                             "Labels": {
+                                    "Vendor": "Acme",
+                                    "License": "GPL",
+                                    "Version": "1.0"
+                             },
                              "Volumes": null,
                              "VolumesFrom": "",
                              "WorkingDir": ""

+ 2 - 0
docs/sources/reference/commandline/cli.md

@@ -1662,6 +1662,8 @@ removed before the image is removed.
       --link=[]                  Add link to another container
       --lxc-conf=[]              Add custom lxc options
       -m, --memory=""            Memory limit
+      -l, --label=[]             Set meta data on a container, for example com.example.key=value
+      -label-file=[]             Read in a line delimited file of labels
       --mac-address=""           Container MAC address (e.g. 92:d0:c6:0a:29:33)
       --memory-swap=""           Total memory (memory + swap), '-1' to disable swap
       --name=""                  Assign a name to the container