PID namespace

The namespace that decides which other processes a process can see and how they are numbered.

In more detail

Inside a new PID namespace the first process becomes PID 1 and cannot see processes outside. Running a container with --pid=host puts it in the host PID namespace instead, so ps shows every process on the machine. Monitoring agents are run this way on purpose; ordinary services should not be.

Example

docker run --rm --pid=host alpine:3.20 ps -o comm

Related terms

Taught in

References

Certification courses