Browse code

Bring API docs inline with 1.3

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2014/10/22 03:44:06
Showing 3 changed files
... ...
@@ -56,6 +56,12 @@ total memory available (`MemTotal`).
56 56
 **New!**
57 57
 You can set the new container's MAC address explicitly.
58 58
 
59
+`POST /containers/(id)/start`
60
+
61
+**New!**
62
+Passing the container's `HostConfig` on start is now deprecated.  You should
63
+set this when creating the container.
64
+
59 65
 ## v1.15
60 66
 
61 67
 ### Full Documentation
... ...
@@ -64,6 +70,12 @@ You can set the new container's MAC address explicitly.
64 64
 
65 65
 ### What's new
66 66
 
67
+`POST /containers/create`
68
+
69
+**New!**
70
+It is now possible to set a container's HostConfig when creating a container.
71
+Previously this was only available when starting a container.
72
+
67 73
 ## v1.14
68 74
 
69 75
 ### Full Documentation
... ...
@@ -117,7 +117,6 @@ Create a container
117 117
              "AttachStdin":false,
118 118
              "AttachStdout":true,
119 119
              "AttachStderr":true,
120
-             "PortSpecs":null,
121 120
              "Tty":false,
122 121
              "OpenStdin":false,
123 122
              "StdinOnce":false,
... ...
@@ -125,6 +124,7 @@ Create a container
125 125
              "Cmd":[
126 126
                      "date"
127 127
              ],
128
+             "Entrypoint": ""
128 129
              "Image":"base",
129 130
              "Volumes":{
130 131
                      "/tmp": {}
... ...
@@ -135,7 +135,23 @@ Create a container
135 135
              "ExposedPorts":{
136 136
                      "22/tcp": {}
137 137
              },
138
-             "RestartPolicy": { "Name": "always" }
138
+             "SecurityOpts": [""],
139
+             "HostConfig": {
140
+               "Binds":["/tmp:/tmp"],
141
+               "Links":["redis3:redis"],
142
+               "LxcConf":{"lxc.utsname":"docker"},
143
+               "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
144
+               "PublishAllPorts":false,
145
+               "Privileged":false,
146
+               "Dns": ["8.8.8.8"],
147
+               "DnsSearch": [""],
148
+               "VolumesFrom": ["parent", "other:ro"],
149
+               "CapAdd": ["NET_ADMIN"],
150
+               "CapDrop": ["MKNOD"],
151
+               "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
152
+               "NetworkMode": "bridge",
153
+               "Devices": []
154
+            }
139 155
         }
140 156
 
141 157
 **Example response**:
... ...
@@ -144,21 +160,78 @@ Create a container
144 144
         Content-Type: application/json
145 145
 
146 146
         {
147
-             "Id":"e90e34656806"
147
+             "Id":"f91ddc4b01e079c4481a8340bbbeca4dbd33d6e4a10662e499f8eacbb5bf252b"
148 148
              "Warnings":[]
149 149
         }
150 150
 
151 151
 Json Parameters:
152 152
 
153
--   **RestartPolicy** – The behavior to apply when the container exits.  The
154
-        value is an object with a `Name` property of either `"always"` to
155
-        always restart or `"on-failure"` to restart only when the container
156
-        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
157
-        controls the number of times to retry before giving up.
158
-        The default is not to restart. (optional)
153
+-   **Hostname** - A string value containing the desired hostname to use for the
154
+      container.
155
+-   **Domainname** - A string value containing the desired domain name to use
156
+      for the container.
157
+-   **User** - A string value containg the user to use inside the container.
158
+-   **Memory** - Memory limit in bytes.
159
+-   **MemorySwap**- Total memory usage (memory + swap); set `-1` to disable swap.
160
+-   **CpuShares** - An integer value containing the CPU Shares for container
161
+      (ie. the relative weight vs othercontainers).
162
+    **CpuSet** - String value containg the cgroups Cpuset to use.
163
+-   **AttachStdin** - Boolean value, attaches to stdin.
164
+-   **AttachStdout** - Boolean value, attaches to stdout.
165
+-   **AttachStderr** - Boolean value, attaches to stderr.
166
+-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.
167
+-   **OpenStdin** - Boolean value, opens stdin,
168
+-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
169
+-   **Env** - A list of environment variables in the form of `VAR=value`
170
+-   **Cmd** - Command to run specified as a string or an array of strings.
171
+-   **Entrypoint** - Set the entrypoint for the container a a string or an array
172
+      of strings
173
+-   **Image** - String value containing the image name to use for the container
159 174
 -   **Volumes** – An object mapping mountpoint paths (strings) inside the
160 175
         container to empty objects.
161
--   **config** – the container's configuration
176
+-   **WorkingDir** - A string value containing the working dir for commands to
177
+      run in.
178
+-   **NetworkDisabled** - Boolean value, when true disables neworking for the
179
+      container
180
+-   **ExposedPorts** - An object mapping ports to an empty object in the form of:
181
+      `"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
182
+-   **SecurityOpts**: A list of string values to customize labels for MLS
183
+      systems, such as SELinux.
184
+-   **HostConfig**
185
+  -   **Binds** – A list of volume bindings for this container.  Each volume
186
+          binding is a string of the form `container_path` (to create a new
187
+          volume for the container), `host_path:container_path` (to bind-mount
188
+          a host path into the container), or `host_path:container_path:ro`
189
+          (to make the bind-mount read-only inside the container).
190
+  -   **Links** - A list of links for the container.  Each link entry should be of
191
+        of the form "container_name:alias".
192
+  -   **LxcConf** - LXC specific configurations.  These configurations will only
193
+        work when using the `lxc` execution driver.
194
+  -   **PortBindings** - A map of exposed container ports and the host port they
195
+        should map to. It should be specified in the form
196
+        `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
197
+        Take note that `port` is specified as a string and not an integer value.
198
+  -   **PublishAllPorts** - Allocates a random host port for all of a container's
199
+        exposed ports. Specified as a boolean value.
200
+  -   **Privileged** - Gives the container full access to the host.  Specified as
201
+        a boolean value.
202
+  -   **Dns** - A list of dns servers for the container to use.
203
+  -   **DnsSearch** - A list of DNS search domains
204
+  -   **VolumesFrom** - A list of volumes to inherit from another container.
205
+        Specified in the form `<container name>[:<ro|rw>]`
206
+  -   **CapAdd** - A list of kernel capabilties to add to the container.
207
+  -   **Capdrop** - A list of kernel capabilties to drop from the container.
208
+  -   **RestartPolicy** – The behavior to apply when the container exits.  The
209
+          value is an object with a `Name` property of either `"always"` to
210
+          always restart or `"on-failure"` to restart only when the container
211
+          exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
212
+          controls the number of times to retry before giving up.
213
+          The default is not to restart. (optional)
214
+  -   **NetworkMode** - Sets the networking mode for the container. Supported
215
+        values are: `bridge`, `host`, and `container:<name|id>`
216
+  -   **Devices** - A list of devices to add to the container specified in the
217
+        form
218
+        `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
162 219
 
163 220
 Query Parameters:
164 221
 
... ...
@@ -437,9 +510,13 @@ Start the container `id`
437 437
              "PublishAllPorts":false,
438 438
              "Privileged":false,
439 439
              "Dns": ["8.8.8.8"],
440
+             "DnsSearch": [""],
440 441
              "VolumesFrom": ["parent", "other:ro"],
441 442
              "CapAdd": ["NET_ADMIN"],
442
-             "CapDrop": ["MKNOD"]
443
+             "CapDrop": ["MKNOD"],
444
+             "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
445
+             "NetworkMode": "bridge",
446
+             "Devices": []
443 447
         }
444 448
 
445 449
 **Example response**:
... ...
@@ -447,13 +524,40 @@ Start the container `id`
447 447
         HTTP/1.1 204 No Content
448 448
 
449 449
 Json Parameters:
450
-
451 450
 -   **Binds** – A list of volume bindings for this container.  Each volume
452 451
         binding is a string of the form `container_path` (to create a new
453 452
         volume for the container), `host_path:container_path` (to bind-mount
454 453
         a host path into the container), or `host_path:container_path:ro`
455 454
         (to make the bind-mount read-only inside the container).
456
--   **hostConfig** – the container's host configuration (optional)
455
+-   **Links** - A list of links for the container.  Each link entry should be of
456
+      of the form "container_name:alias".
457
+-   **LxcConf** - LXC specific configurations.  These configurations will only
458
+      work when using the `lxc` execution driver.
459
+-   **PortBindings** - A map of exposed container ports and the host port they
460
+      should map to. It should be specified in the form
461
+      `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
462
+      Take note that `port` is specified as a string and not an integer value.
463
+-   **PublishAllPorts** - Allocates a random host port for all of a container's
464
+      exposed ports. Specified as a boolean value.
465
+-   **Privileged** - Gives the container full access to the host.  Specified as
466
+      a boolean value.
467
+-   **Dns** - A list of dns servers for the container to use.
468
+-   **DnsSearch** - A list of DNS search domains
469
+-   **VolumesFrom** - A list of volumes to inherit from another container.
470
+      Specified in the form `<container name>[:<ro|rw>]`
471
+-   **CapAdd** - A list of kernel capabilties to add to the container.
472
+-   **Capdrop** - A list of kernel capabilties to drop from the container.
473
+-   **RestartPolicy** – The behavior to apply when the container exits.  The
474
+        value is an object with a `Name` property of either `"always"` to
475
+        always restart or `"on-failure"` to restart only when the container
476
+        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
477
+        controls the number of times to retry before giving up.
478
+        The default is not to restart. (optional)
479
+-   **NetworkMode** - Sets the networking mode for the container. Supported
480
+      values are: `bridge`, `host`, and `container:<name|id>`
481
+-   **Devices** - A list of devices to add to the container specified in the
482
+      form
483
+      `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
457 484
 
458 485
 Status Codes:
459 486
 
... ...
@@ -117,7 +117,6 @@ Create a container
117 117
              "AttachStdin":false,
118 118
              "AttachStdout":true,
119 119
              "AttachStderr":true,
120
-             "PortSpecs":null,
121 120
              "Tty":false,
122 121
              "OpenStdin":false,
123 122
              "StdinOnce":false,
... ...
@@ -125,6 +124,7 @@ Create a container
125 125
              "Cmd":[
126 126
                      "date"
127 127
              ],
128
+             "Entrypoint": ""
128 129
              "Image":"base",
129 130
              "Volumes":{
130 131
                      "/tmp": {}
... ...
@@ -135,7 +135,23 @@ Create a container
135 135
              "ExposedPorts":{
136 136
                      "22/tcp": {}
137 137
              },
138
-             "RestartPolicy": { "Name": "always" }
138
+             "SecurityOpts": [""],
139
+             "HostConfig": {
140
+               "Binds":["/tmp:/tmp"],
141
+               "Links":["redis3:redis"],
142
+               "LxcConf":{"lxc.utsname":"docker"},
143
+               "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
144
+               "PublishAllPorts":false,
145
+               "Privileged":false,
146
+               "Dns": ["8.8.8.8"],
147
+               "DnsSearch": [""],
148
+               "VolumesFrom": ["parent", "other:ro"],
149
+               "CapAdd": ["NET_ADMIN"],
150
+               "CapDrop": ["MKNOD"],
151
+               "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
152
+               "NetworkMode": "bridge",
153
+               "Devices": []
154
+            }
139 155
         }
140 156
 
141 157
 **Example response**:
... ...
@@ -150,15 +166,72 @@ Create a container
150 150
 
151 151
 Json Parameters:
152 152
 
153
--   **RestartPolicy** – The behavior to apply when the container exits.  The
154
-        value is an object with a `Name` property of either `"always"` to
155
-        always restart or `"on-failure"` to restart only when the container
156
-        exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
157
-        controls the number of times to retry before giving up.
158
-        The default is not to restart. (optional)
153
+-   **Hostname** - A string value containing the desired hostname to use for the
154
+      container.
155
+-   **Domainname** - A string value containing the desired domain name to use
156
+      for the container.
157
+-   **User** - A string value containg the user to use inside the container.
158
+-   **Memory** - Memory limit in bytes.
159
+-   **MemorySwap**- Total memory usage (memory + swap); set `-1` to disable swap.
160
+-   **CpuShares** - An integer value containing the CPU Shares for container
161
+      (ie. the relative weight vs othercontainers).
162
+    **CpuSet** - String value containg the cgroups Cpuset to use.
163
+-   **AttachStdin** - Boolean value, attaches to stdin.
164
+-   **AttachStdout** - Boolean value, attaches to stdout.
165
+-   **AttachStderr** - Boolean value, attaches to stderr.
166
+-   **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.
167
+-   **OpenStdin** - Boolean value, opens stdin,
168
+-   **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
169
+-   **Env** - A list of environment variables in the form of `VAR=value`
170
+-   **Cmd** - Command to run specified as a string or an array of strings.
171
+-   **Entrypoint** - Set the entrypoint for the container a a string or an array
172
+      of strings
173
+-   **Image** - String value containing the image name to use for the container
159 174
 -   **Volumes** – An object mapping mountpoint paths (strings) inside the
160 175
         container to empty objects.
161
--   **config** – the container's configuration
176
+-   **WorkingDir** - A string value containing the working dir for commands to
177
+      run in.
178
+-   **NetworkDisabled** - Boolean value, when true disables neworking for the
179
+      container
180
+-   **ExposedPorts** - An object mapping ports to an empty object in the form of:
181
+      `"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
182
+-   **SecurityOpts**: A list of string values to customize labels for MLS
183
+      systems, such as SELinux.
184
+-   **HostConfig**
185
+  -   **Binds** – A list of volume bindings for this container.  Each volume
186
+          binding is a string of the form `container_path` (to create a new
187
+          volume for the container), `host_path:container_path` (to bind-mount
188
+          a host path into the container), or `host_path:container_path:ro`
189
+          (to make the bind-mount read-only inside the container).
190
+  -   **Links** - A list of links for the container.  Each link entry should be of
191
+        of the form "container_name:alias".
192
+  -   **LxcConf** - LXC specific configurations.  These configurations will only
193
+        work when using the `lxc` execution driver.
194
+  -   **PortBindings** - A map of exposed container ports and the host port they
195
+        should map to. It should be specified in the form
196
+        `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
197
+        Take note that `port` is specified as a string and not an integer value.
198
+  -   **PublishAllPorts** - Allocates a random host port for all of a container's
199
+        exposed ports. Specified as a boolean value.
200
+  -   **Privileged** - Gives the container full access to the host.  Specified as
201
+        a boolean value.
202
+  -   **Dns** - A list of dns servers for the container to use.
203
+  -   **DnsSearch** - A list of DNS search domains
204
+  -   **VolumesFrom** - A list of volumes to inherit from another container.
205
+        Specified in the form `<container name>[:<ro|rw>]`
206
+  -   **CapAdd** - A list of kernel capabilties to add to the container.
207
+  -   **Capdrop** - A list of kernel capabilties to drop from the container.
208
+  -   **RestartPolicy** – The behavior to apply when the container exits.  The
209
+          value is an object with a `Name` property of either `"always"` to
210
+          always restart or `"on-failure"` to restart only when the container
211
+          exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
212
+          controls the number of times to retry before giving up.
213
+          The default is not to restart. (optional)
214
+  -   **NetworkMode** - Sets the networking mode for the container. Supported
215
+        values are: `bridge`, `host`, and `container:<name|id>`
216
+  -   **Devices** - A list of devices to add to the container specified in the
217
+        form
218
+        `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
162 219
 
163 220
 Query Parameters:
164 221
 
... ...
@@ -429,32 +502,12 @@ Start the container `id`
429 429
         POST /containers/(id)/start HTTP/1.1
430 430
         Content-Type: application/json
431 431
 
432
-        {
433
-             "Binds":["/tmp:/tmp"],
434
-             "Links":["redis3:redis"],
435
-             "LxcConf":{"lxc.utsname":"docker"},
436
-             "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
437
-             "PublishAllPorts":false,
438
-             "Privileged":false,
439
-             "Dns": ["8.8.8.8"],
440
-             "VolumesFrom": ["parent", "other:ro"],
441
-             "CapAdd": ["NET_ADMIN"],
442
-             "CapDrop": ["MKNOD"]
443
-        }
444
-
445 432
 **Example response**:
446 433
 
447 434
         HTTP/1.1 204 No Content
448 435
 
449 436
 Json Parameters:
450 437
 
451
--   **Binds** – A list of volume bindings for this container.  Each volume
452
-        binding is a string of the form `container_path` (to create a new
453
-        volume for the container), `host_path:container_path` (to bind-mount
454
-        a host path into the container), or `host_path:container_path:ro`
455
-        (to make the bind-mount read-only inside the container).
456
--   **hostConfig** – the container's host configuration (optional)
457
-
458 438
 Status Codes:
459 439
 
460 440
 -   **204** – no error