Understanding Linux Namespaces: Enhancing Process Isolation and Resource Management
Linux namespaces are a key feature of containerization in Linux. They provide process isolation, making it seem as if a process has its instance of global system resources. There are eight main types of Linux namespaces, each isolating a specific aspect of system resources.
1. Mount (mnt)
2. Process ID (pid)
3. Network (net)
4. Interprocess Communication (ipc)
5. UTS (UNIX Timesharing System)
6. User (user)
7. Cgroup (cgroup)
8. Time (time) (added in Linux 5.6)
Namespace Isolates Example CLI
mnt Filesystems unshare --mount /bin/bash
pid Process IDs unshare --pid --fork /bin/bash
net Network stack ip netns add myns
ipc IPC mechanisms unshare --ipc /bin/bash
uts Hostname/domain unshare --uts /bin/bash
user UID/GID mappings unshare --user --map-root-user bash
cgroup Control groups unshare --cgroup bash
time System clocks unshare --time /bin/bash