Container Fundamentals
Cheat sheet · https://pcornel.dk/topic.php?topic=6073
Answer
A container is a normal process on the host, isolated with namespaces (what it can see) and limited with cgroups (what it can use), started from an image that provides its filesystem. Containers share the host kernel.
Remember
Containers are not VMs: a kernel bug or a privileged container affects the host. Data written inside the container layer disappears when it is removed. Run one main process per container and let the runtime restart it.
First checks
docker ps -a— containers and exit codesdocker logs <c>— container outputdocker inspect <c>— config, mounts, network, state
Verify in this order
image → container created with namespaces and cgroups → process runs on the shared kernel → logs/volumes
Where it usually breaks
Common mistakes are confusing image state with container state, assuming isolation implies a separate kernel, treating a restart loop as a networking problem before reading the exit reason, or measuring only host capacity while a cgroup limit is the real constraint.
Container Fundamentals verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | Containers vs virtual machines | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Images, containers and runtime state / Linux namespaces and cgroups | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | OCI image/runtime model | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | Container lifecycle and exit state | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6073