What makes a process a container to the kernel
container internals beyond the basics.
namespaces isolate and cgroups limit, but also capabilities, seccomp filters, mount/pivot_root for the rootfs, and SELinux/AppArmor labels.
What's really being asked
Whether you can go past the textbook namespaces-and-cgroups answer to the full set of kernel features that constrain a containerized process, and whether you know it shares the host kernel.
The full answer
From the kernel's view a container is a normal process; nothing about its scheduling or execution is fundamentally new. What differs is the bundle of constraints applied. Namespaces give it isolated views of PIDs, network, mounts, users, IPC, UTS and cgroups so it sees its own slice of the system. Cgroups cap and account its CPU, memory, IO and pids. Beyond those, the process runs with a reduced Linux capability set, dropping privileges like raw networking or mounting unless explicitly granted. A seccomp profile filters which syscalls it may invoke, shrinking the attack surface. Its root filesystem is swapped via a mount namespace plus pivot_root or chroot so it sees the image's rootfs, not the host's. Mandatory access control through SELinux or AppArmor labels confines what files and operations it can touch. The no_new_privs flag often prevents privilege escalation. All of this runs on the single shared host kernel; there is no separate guest kernel as in a virtual machine.
The mistakes people make
Stopping at namespaces and cgroups, which the question explicitly asks you to exceed. Saying a container has its own kernel or boots an OS; it does not, which is the key distinction from VMs. Forgetting security layers like capabilities, seccomp and MAC that are central to container isolation.
What usually comes next
Why is sharing the kernel both efficient and a weaker isolation boundary than a VM? What does a privileged container actually relax? How do gVisor or Kata change the model by adding a kernel boundary? How does rootless containerization use user namespaces?
A concrete example
Running nginx in a container, ps on the host shows an ordinary nginx process. Yet it lives in its own PID and network namespaces, is capped to half a CPU and 256 MiB by cgroups, has dropped CAP_SYS_ADMIN, runs under a seccomp profile blocking dangerous syscalls, sees the image rootfs via pivot_root, and is labeled by SELinux, all while executing on the same kernel as the host.
Interview question
Beyond namespaces and cgroups, which combination most accurately describes how the kernel constrains a containerized process?
- a.A dedicated guest kernel booted per container
- b.Reduced capabilities, a seccomp syscall filter, a pivoted rootfs, and MAC labels, all on the shared host kernelCorrect
- c.Only stricter filesystem permissions enforced at the application layer
- d.A hardware hypervisor isolating the process from the host kernel
Why? this is the answer
A container is a host process additionally constrained by dropped capabilities, seccomp filtering, a pivoted root filesystem, and SELinux/AppArmor labels, sharing the host kernel. There is no guest kernel or hypervisor, which distinguishes containers from VMs.
Just read this? Test yourself on what you have been reading.
Read the original → developers.redhat.com
- #containers
- #linux
- #namespaces
- #cgroups
- #security
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on containers — each one lists the topics its interview covers.
See open roles