Pcornel
Containers

Container Fundamentals

Cheat sheet · https://pcornel.dk/topic.php?topic=6073

Back to the Topic

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 codes
  • docker logs <c> — container output
  • docker 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

BoundaryInspectHealthy interpretationDo not infer
IntentContainers vs virtual machinesIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeImages, containers and runtime state / Linux namespaces and cgroupsOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateOCI image/runtime modelIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeContainer lifecycle and exit stateThe original bounded check succeeds in the same time windowProduction 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

Confirmation

Confirm action

Continue?