Browse code

Add missing API docs for HostConfig.PidMode

The `--pid` flag was added in Docker 1.5.0, but the
API changes were not documented. In Docker 1.12.0,
`--pid=container:<name|id>` was added as an additional
option, but also undocumented.

This adds the missing API documentation for this
option.

Also see commits
47e3da848ffbe88d0188ae6cfc09d6e1668bc293 (for 1.5.0), and
ebeb5a0422be47e703353e327606a380eb9962ab (for 1.12.0).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2c9b5addc5022dba33d5d0443b49b2e4c0041ef3)
Signed-off-by: Tibor Vass <tibor@docker.com>

Sebastiaan van Stijn authored on 2016/07/12 08:52:42
Showing 8 changed files
... ...
@@ -137,6 +137,8 @@ This section lists each version from latest to oldest.  Each listing includes a
137 137
   no longer expects a "Container" field to be present. This property was not used
138 138
   and is no longer sent by the docker client.
139 139
 * `POST /containers/create/` now validates the hostname (should be a valid RFC 1123 hostname).
140
+* `POST /containers/create/` `HostConfig.PidMode` field now accepts `container:<name|id>`,
141
+  to have the container join the PID namespace of an existing container.
140 142
 
141 143
 ### v1.23 API changes
142 144
 
... ...
@@ -169,6 +169,7 @@ Create a container
169 169
                "MemorySwap": 0,
170 170
                "CpuShares": 512,
171 171
                "CpusetCpus": "0,1",
172
+               "PidMode": "",
172 173
                "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
173 174
                "PublishAllPorts": false,
174 175
                "Privileged": false,
... ...
@@ -242,6 +243,9 @@ Json Parameters:
242 242
     -   **CpuShares** - An integer value containing the CPU Shares for container
243 243
           (ie. the relative weight vs other containers).
244 244
     -   **CpusetCpus** - String value containing the cgroups CpusetCpus to use.
245
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
246
+          `"container:<name|id>"`: joins another container's PID namespace
247
+          `"host"`: use the host's PID namespace inside the container
245 248
     -   **PortBindings** - A map of exposed container ports and the host port they
246 249
           should map to. It should be specified in the form
247 250
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
... ...
@@ -373,6 +377,7 @@ Return low-level information on the container `id`
373 373
 			"Memory": 0,
374 374
 			"MemorySwap": 0,
375 375
 			"NetworkMode": "bridge",
376
+			"PidMode": "",
376 377
 			"PortBindings": {},
377 378
 			"Privileged": false,
378 379
 			"ReadonlyRootfs": false,
... ...
@@ -176,6 +176,7 @@ Create a container
176 176
              "CpusetMems": "0,1",
177 177
              "BlkioWeight": 300,
178 178
              "OomKillDisable": false,
179
+             "PidMode": "",
179 180
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
180 181
              "PublishAllPorts": false,
181 182
              "Privileged": false,
... ...
@@ -253,6 +254,9 @@ Json Parameters:
253 253
     -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
254 254
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
255 255
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
256
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
257
+          `"container:<name|id>"`: joins another container's PID namespace
258
+          `"host"`: use the host's PID namespace inside the container
256 259
     -   **PortBindings** - A map of exposed container ports and the host port they
257 260
           should map to. A JSON object in the form
258 261
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
... ...
@@ -388,6 +392,7 @@ Return low-level information on the container `id`
388 388
 			"MemorySwap": 0,
389 389
 			"OomKillDisable": false,
390 390
 			"NetworkMode": "bridge",
391
+			"PidMode": "",
391 392
 			"PortBindings": {},
392 393
 			"Privileged": false,
393 394
 			"ReadonlyRootfs": false,
... ...
@@ -177,6 +177,7 @@ Create a container
177 177
              "BlkioWeight": 300,
178 178
              "MemorySwappiness": 60,
179 179
              "OomKillDisable": false,
180
+             "PidMode": "",
180 181
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
181 182
              "PublishAllPorts": false,
182 183
              "Privileged": false,
... ...
@@ -256,6 +257,9 @@ Json Parameters:
256 256
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
257 257
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
258 258
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
259
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
260
+          `"container:<name|id>"`: joins another container's PID namespace
261
+          `"host"`: use the host's PID namespace inside the container
259 262
     -   **PortBindings** - A map of exposed container ports and the host port they
260 263
           should map to. A JSON object in the form
261 264
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
... ...
@@ -391,6 +395,7 @@ Return low-level information on the container `id`
391 391
 			"MemorySwap": 0,
392 392
 			"OomKillDisable": false,
393 393
 			"NetworkMode": "bridge",
394
+			"PidMode": "",
394 395
 			"PortBindings": {},
395 396
 			"Privileged": false,
396 397
 			"ReadonlyRootfs": false,
... ...
@@ -184,6 +184,7 @@ Create a container
184 184
              "BlkioWeight": 300,
185 185
              "MemorySwappiness": 60,
186 186
              "OomKillDisable": false,
187
+             "PidMode": "",
187 188
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
188 189
              "PublishAllPorts": false,
189 190
              "Privileged": false,
... ...
@@ -271,6 +272,9 @@ Json Parameters:
271 271
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
272 272
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
273 273
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
274
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
275
+          `"container:<name|id>"`: joins another container's PID namespace
276
+          `"host"`: use the host's PID namespace inside the container
274 277
     -   **PortBindings** - A map of exposed container ports and the host port they
275 278
           should map to. A JSON object in the form
276 279
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
... ...
@@ -414,6 +418,7 @@ Return low-level information on the container `id`
414 414
 			"KernelMemory": 0,
415 415
 			"OomKillDisable": false,
416 416
 			"NetworkMode": "bridge",
417
+			"PidMode": "",
417 418
 			"PortBindings": {},
418 419
 			"Privileged": false,
419 420
 			"ReadonlyRootfs": false,
... ...
@@ -277,6 +277,7 @@ Create a container
277 277
              "MemorySwappiness": 60,
278 278
              "OomKillDisable": false,
279 279
              "OomScoreAdj": 500,
280
+             "PidMode": "",
280 281
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
281 282
              "PublishAllPorts": false,
282 283
              "Privileged": false,
... ...
@@ -382,6 +383,9 @@ Json Parameters:
382 382
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
383 383
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
384 384
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
385
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
386
+          `"container:<name|id>"`: joins another container's PID namespace
387
+          `"host"`: use the host's PID namespace inside the container
385 388
     -   **PortBindings** - A map of exposed container ports and the host port they
386 389
           should map to. A JSON object in the form
387 390
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
... ...
@@ -534,6 +538,7 @@ Return low-level information on the container `id`
534 534
 			"OomKillDisable": false,
535 535
 			"OomScoreAdj": 500,
536 536
 			"NetworkMode": "bridge",
537
+			"PidMode": "",
537 538
 			"PortBindings": {},
538 539
 			"Privileged": false,
539 540
 			"ReadonlyRootfs": false,
... ...
@@ -296,6 +296,7 @@ Create a container
296 296
              "MemorySwappiness": 60,
297 297
              "OomKillDisable": false,
298 298
              "OomScoreAdj": 500,
299
+             "PidMode": "",
299 300
              "PidsLimit": -1,
300 301
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
301 302
              "PublishAllPorts": false,
... ...
@@ -402,6 +403,9 @@ Json Parameters:
402 402
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
403 403
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
404 404
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
405
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
406
+          `"container:<name|id>"`: joins another container's PID namespace
407
+          `"host"`: use the host's PID namespace inside the container
405 408
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
406 409
     -   **PortBindings** - A map of exposed container ports and the host port they
407 410
           should map to. A JSON object in the form
... ...
@@ -557,6 +561,7 @@ Return low-level information on the container `id`
557 557
 			"OomKillDisable": false,
558 558
 			"OomScoreAdj": 500,
559 559
 			"NetworkMode": "bridge",
560
+			"PidMode": "",
560 561
 			"PortBindings": {},
561 562
 			"Privileged": false,
562 563
 			"ReadonlyRootfs": false,
... ...
@@ -310,6 +310,7 @@ Create a container
310 310
              "MemorySwappiness": 60,
311 311
              "OomKillDisable": false,
312 312
              "OomScoreAdj": 500,
313
+             "PidMode": "",
313 314
              "PidsLimit": -1,
314 315
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
315 316
              "PublishAllPorts": false,
... ...
@@ -421,6 +422,9 @@ Create a container
421 421
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
422 422
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
423 423
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
424
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
425
+          `"container:<name|id>"`: joins another container's PID namespace
426
+          `"host"`: use the host's PID namespace inside the container
424 427
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
425 428
     -   **PortBindings** - A map of exposed container ports and the host port they
426 429
           should map to. A JSON object in the form
... ...
@@ -583,6 +587,7 @@ Return low-level information on the container `id`
583 583
 			"OomKillDisable": false,
584 584
 			"OomScoreAdj": 500,
585 585
 			"NetworkMode": "bridge",
586
+			"PidMode": "",
586 587
 			"PortBindings": {},
587 588
 			"Privileged": false,
588 589
 			"ReadonlyRootfs": false,