Posts

Showing posts with the label Containers

KB: What are containers (chroot & cgroup)

 Dockers/Kubernetes are a glorified chroot and cgroups ;) Root and Chroot In a Unix-like OS, root directory(/) is the top directory. root file system sits on the same disk partition where root directory is located. And it is on top of this root file system that all other file systems are mounted. All file system entries branch out of this root. This is the system’s actual root. But each process has its own idea of what the root directory is. By default, it is actual system root but we can change this by using chroot()system call. We can have a different root so that we can create a separate environment to run so that it becomes easier to run and debug the process. Or it may also be to use legacy dependencies and libraries for the process. chroot changes the apparent root directory for the current running process and its children. cgroups- Isolate and manage resources Control groups(cgroups) is a Linux kernel feature which limits, isolates and measures resource usage of a group of p...