Use this when deciding how strongly containers are isolated from each other and the host.
Container Isolation
Container isolation relies on Linux namespaces, cgroups, capabilities and seccomp, sharing the host kernel. It is weaker than VM isolation, so sandboxed runtimes like gVisor or Kata are used for untrusted code.
1. Isolation uses namespaces, cgroups, capabilities, seccomp, LSMs.
2. Weaker than VMs — kernel is shared.
3. Use sandboxed runtimes for untrusted code.
4. Never mount the Docker socket into containers.
5. Avoid host namespaces.
container → namespaces + cgroups + seccomp + LSM → host kernel
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
docker inspect <ctr> --format '{{.HostConfig.Privileged}} {{.HostConfig.CapAdd}}'
cat /proc/<pid>/status | grep -E 'Cap|Seccomp|NoNewPrivs'
lsns -p <pid>
Step 2 Common mistakes Narrow the fault
--privilegeddisabling most isolation.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Namespaces and cgroups isolate; the kernel is shared.
- Kernel bugs can allow escapes.
- Use sandboxed runtimes for untrusted code.
docker info | grep -i -e security -e cgroup— isolation featurescat /proc/<pid>/status | grep -E 'Cap|Seccomp|NoNewPrivs'— process confinement- Sandboxed runtimes (gVisor/Kata) for untrusted workloads — stronger isolation
ReferenceWhy it matters1 section · depth on demand
Isolation layers
| Mechanism | Isolates |
|---|---|
| Namespaces | PID, network, mount, user, IPC, UTS |
| cgroups | CPU, memory, PIDs limits |
| Capabilities | Root privileges split up |
| Seccomp | Syscalls |
| AppArmor/SELinux | File and resource access |
| gVisor/Kata | Stronger: user-space kernel / micro-VM |
ReferenceImportant terms & boundaries1 section · depth on demand
How it works
Containers are processes isolated by Linux namespaces (what they can see), cgroups (what they can use), capabilities (which root powers they have), seccomp (which syscalls they can make) and LSMs such as AppArmor/SELinux. All share the host kernel, so a kernel exploit can break isolation.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Container Security → Container Isolation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/sp/800/190/final · confidence 94%