Merge pull request #22481 from mrunalp/pid_container

Add support for --pid=container:<id>
Upstream-commit: ebeb5a0422be47e703353e327606a380eb9962ab
Component: engine
This commit is contained in:
Vincent Demeester
2016-05-19 19:00:40 +02:00
9 changed files with 154 additions and 13 deletions

View File

@ -193,7 +193,8 @@ the digest value is predictable and referenceable.
## PID settings (--pid)
--pid="" : Set the PID (Process) Namespace mode for the container,
'host': use the host's PID namespace inside the container
'container:<name|id>': joins another container's PID namespace
'host': use the host's PID namespace inside the container
By default, all containers have the PID namespace enabled.
@ -229,6 +230,23 @@ Use the following command to run `htop` inside a container:
$ docker run -it --rm --pid=host myhtop
```
Joining another container's pid namespace can be used for debugging that container.
### Example
Start a container running a redis server:
```bash
$ docker run --name my-redis -d redis
```
Debug the redis container by running another container that has strace in it:
```bash
$ docker run --it --pid=container:my-redis bash
$ strace -p 1
```
## UTS settings (--uts)
--uts="" : Set the UTS namespace mode for the container,