Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)
Linux Namespaces and cgroups v2: The Foundation of Containers.
senior LevelSecurity & AuthDocker & Containers
In Simple Words: Containers are not lightweight virtual machines; they are standard Linux processes isolated by two kernel primitives:
- Namespaces (Isolation - What a process can see):
pid: Process isolation (container process thinks it is PID 1).net: Isolated network interfaces, routing tables, and IP ports.mnt: Independent filesystem mount points.ipc: Inter-process communication isolation (semaphores, message queues).uts: Hostname and NIS domain isolation.user: Maps containerroot(UID 0) to an unprivileged host user (e.g. UID 10000).
- Control Groups (cgroups v2 - What a process can use): Enforces hard resource ceilings on CPU cycles, RAM, swap space, and disk I/O throughput.