Skip to main content
InterviewHubPRO
Section Overview
Q25

Question 25 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

50%
Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

Deep Dive into the 7 Linux Namespaces: How the Kernel Implements Container Isolation.

senior LevelCode ExampleSecurity & AuthDocker & Containers

In Simple Words: Namespaces wrap global system resources in an abstraction such that processes within the namespace believe they have their own isolated instance of that resource.

  1. PID (Process IDs): Isolates process IDs. The container entrypoint becomes PID 1 inside the container, while retaining its true host PID (e.g., 4289) on the host.
  2. NET (Networking): Isolates network devices, IP routing tables, port bindings, and firewall iptables.
  3. MNT (Mount Points): Isolates filesystem mount points. The container sees only its pivot_root mount point.
  4. IPC (Inter-Process Communication): Isolates System V IPC and POSIX message queues and shared memory segments (shm).
  5. UTS (Hostnames): Isolates nodename and domainname (hostname can be set uniquely per container).
  6. USER (User & Group IDs): Maps container UID 0 (root) to an unprivileged host UID (e.g., UID 100000).
  7. CGROUP (Control Group): Isolates the view of cgroup hierarchies within /proc/self/cgroup.
objectivec
Linux Kernel Syscall: clone(flags = CLONE_NEWPID | CLONE_NEWNET | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS)