namespace (Linux)
A Linux kernel feature that controls what a process can see, such as which other processes, network or host name.
In more detail
Linux has eight kinds of namespace: cgroup, IPC, mount, network, PID, time, user and UTS. Every process is in one namespace of each kind, and two processes see each other through a namespace only if they share its identifier, the number shown in square brackets under /proc/self/ns. Docker gives each container fresh namespaces; flags like --pid=host hand one back to the host. Namespaces hide things but do not create a second kernel. Not the same as an image namespace, which is part of an image name.
Examples
ls /proc/self/nsreadlink /proc/self/ns/pid # pid:[4026532211]Related terms
- PID namespace — The namespace that decides which other processes a process can see and how they are numbered.
- network namespace — The namespace that gives a process its own network interfaces, addresses, routes and ports.
- mount namespace — The namespace that gives a process its own list of mounted filesystems, and so its own view of the directory tree.
- user namespace — The namespace that can map the root user inside a container to an unprivileged user on the host.
- UTS namespace — The namespace that gives a process its own host name.
- IPC namespace — The namespace that separates the shared-memory areas and message queues processes use to talk to each other.
- control group — A Linux kernel feature that limits how much memory, processor time and other resources a group of processes may use.
Taught in
- Why Containers: Bare Metal, Machines And Processes — Docker Architecture & Production Containers
- Namespaces And Cgroups: Isolation And Limits — Docker Architecture & Production Containers
- Union Filesystems, Images And Writable Layers — Docker Architecture & Production Containers
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers