Explorar o código

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>
Sebastiaan van Stijn %!s(int64=9) %!d(string=hai) anos
pai
achega
2c9b5addc5

+ 2 - 0
docs/reference/api/docker_remote_api.md

@@ -137,6 +137,8 @@ This section lists each version from latest to oldest.  Each listing includes a
   no longer expects a "Container" field to be present. This property was not used
   no longer expects a "Container" field to be present. This property was not used
   and is no longer sent by the docker client.
   and is no longer sent by the docker client.
 * `POST /containers/create/` now validates the hostname (should be a valid RFC 1123 hostname).
 * `POST /containers/create/` now validates the hostname (should be a valid RFC 1123 hostname).
+* `POST /containers/create/` `HostConfig.PidMode` field now accepts `container:<name|id>`,
+  to have the container join the PID namespace of an existing container.
 
 
 ### v1.23 API changes
 ### v1.23 API changes
 
 

+ 5 - 0
docs/reference/api/docker_remote_api_v1.18.md

@@ -169,6 +169,7 @@ Create a container
                "MemorySwap": 0,
                "MemorySwap": 0,
                "CpuShares": 512,
                "CpuShares": 512,
                "CpusetCpus": "0,1",
                "CpusetCpus": "0,1",
+               "PidMode": "",
                "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
                "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
                "PublishAllPorts": false,
                "PublishAllPorts": false,
                "Privileged": false,
                "Privileged": false,
@@ -242,6 +243,9 @@ Json Parameters:
     -   **CpuShares** - An integer value containing the CPU Shares for container
     -   **CpuShares** - An integer value containing the CPU Shares for container
           (ie. the relative weight vs other containers).
           (ie. the relative weight vs other containers).
     -   **CpusetCpus** - String value containing the cgroups CpusetCpus to use.
     -   **CpusetCpus** - String value containing the cgroups CpusetCpus to use.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. It should be specified in the form
           should map to. It should be specified in the form
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
@@ -373,6 +377,7 @@ Return low-level information on the container `id`
 			"Memory": 0,
 			"Memory": 0,
 			"MemorySwap": 0,
 			"MemorySwap": 0,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.19.md

@@ -176,6 +176,7 @@ Create a container
              "CpusetMems": "0,1",
              "CpusetMems": "0,1",
              "BlkioWeight": 300,
              "BlkioWeight": 300,
              "OomKillDisable": false,
              "OomKillDisable": false,
+             "PidMode": "",
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
              "Privileged": false,
              "Privileged": false,
@@ -253,6 +254,9 @@ Json Parameters:
     -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
     -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
@@ -388,6 +392,7 @@ Return low-level information on the container `id`
 			"MemorySwap": 0,
 			"MemorySwap": 0,
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.20.md

@@ -177,6 +177,7 @@ Create a container
              "BlkioWeight": 300,
              "BlkioWeight": 300,
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
+             "PidMode": "",
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
              "Privileged": false,
              "Privileged": false,
@@ -256,6 +257,9 @@ Json Parameters:
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
@@ -391,6 +395,7 @@ Return low-level information on the container `id`
 			"MemorySwap": 0,
 			"MemorySwap": 0,
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.21.md

@@ -184,6 +184,7 @@ Create a container
              "BlkioWeight": 300,
              "BlkioWeight": 300,
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
+             "PidMode": "",
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
              "Privileged": false,
              "Privileged": false,
@@ -271,6 +272,9 @@ Json Parameters:
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
@@ -414,6 +418,7 @@ Return low-level information on the container `id`
 			"KernelMemory": 0,
 			"KernelMemory": 0,
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.22.md

@@ -277,6 +277,7 @@ Create a container
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
              "OomScoreAdj": 500,
              "OomScoreAdj": 500,
+             "PidMode": "",
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
              "Privileged": false,
              "Privileged": false,
@@ -382,6 +383,9 @@ Json Parameters:
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
           `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
@@ -533,6 +537,7 @@ Return low-level information on the container `id`
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"OomScoreAdj": 500,
 			"OomScoreAdj": 500,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.23.md

@@ -296,6 +296,7 @@ Create a container
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
              "OomScoreAdj": 500,
              "OomScoreAdj": 500,
+             "PidMode": "",
              "PidsLimit": -1,
              "PidsLimit": -1,
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
@@ -402,6 +403,9 @@ Json Parameters:
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
@@ -556,6 +560,7 @@ Return low-level information on the container `id`
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"OomScoreAdj": 500,
 			"OomScoreAdj": 500,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.24.md

@@ -310,6 +310,7 @@ Create a container
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
              "OomScoreAdj": 500,
              "OomScoreAdj": 500,
+             "PidMode": "",
              "PidsLimit": -1,
              "PidsLimit": -1,
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
@@ -421,6 +422,9 @@ Create a container
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
@@ -582,6 +586,7 @@ Return low-level information on the container `id`
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"OomScoreAdj": 500,
 			"OomScoreAdj": 500,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,

+ 5 - 0
docs/reference/api/docker_remote_api_v1.25.md

@@ -311,6 +311,7 @@ Create a container
              "MemorySwappiness": 60,
              "MemorySwappiness": 60,
              "OomKillDisable": false,
              "OomKillDisable": false,
              "OomScoreAdj": 500,
              "OomScoreAdj": 500,
+             "PidMode": "",
              "PidsLimit": -1,
              "PidsLimit": -1,
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
              "PublishAllPorts": false,
              "PublishAllPorts": false,
@@ -422,6 +423,9 @@ Create a container
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
     -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
+          `"container:<name|id>"`: joins another container's PID namespace
+          `"host"`: use the host's PID namespace inside the container
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
     -   **PortBindings** - A map of exposed container ports and the host port they
     -   **PortBindings** - A map of exposed container ports and the host port they
           should map to. A JSON object in the form
           should map to. A JSON object in the form
@@ -583,6 +587,7 @@ Return low-level information on the container `id`
 			"OomKillDisable": false,
 			"OomKillDisable": false,
 			"OomScoreAdj": 500,
 			"OomScoreAdj": 500,
 			"NetworkMode": "bridge",
 			"NetworkMode": "bridge",
+			"PidMode": "",
 			"PortBindings": {},
 			"PortBindings": {},
 			"Privileged": false,
 			"Privileged": false,
 			"ReadonlyRootfs": false,
 			"ReadonlyRootfs": false,