Containers Fundamentals
Cheat sheet · https://pcornel.dk/topic.php?topic=2889
Answer
Container fundamentals: an image is a read-only layered filesystem plus metadata; a container is a running instance with its own writable layer, namespaces (pid, net, mnt, uts, ipc, user) and cgroup limits.
Remember
Containers share the host kernel — kernel features and vulnerabilities affect them. Rootless containers (Podman, rootless Docker) reduce risk. Limits (--memory, --cpus) protect the host.
First checks
lsns -p <pid>— namespaces of a processdocker ps -a / podman ps -a— containers and statedocker logs <c>— container outputdocker inspect <c>— configuration, mounts, networkdocker info— engine, storage driver, cgroup version
Commands
docker container diff
Verify in this order
image layers + writable layer → namespaces isolate → cgroups limit → process on the shared kernel
Where it usually breaks
First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2889