Use it to understand what a container is and isn't before troubleshooting or securing one.
Container Fundamentals
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.
1. docker ps -a / kubectl get pods — running or exited?
2. Host view: ps -ef | grep <proc> — it is a host process.
3. Namespaces: lsns -p <pid>; limits: docker stats --no-stream.
4. Data persistence: volumes mounted?
5. Logs for the exit reason.
image → container created with namespaces and cgroups → process runs on the shared kernel → logs/volumes
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. Preserve the first divergent observation and repeat the same bounded verification after remediation.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Linux owns the deep kernel mechanics; Containers owns how namespaces, cgroups, images and runtime lifecycle combine into an operational container. Virtualization owns hypervisors/VMs.
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 Verification workflow Verify boundary
Identify the image digest or tag, runtime, container ID, host and namespace/resource limits for the same workload. Verify configured state with runtime inspection, then confirm process state, exit code, resource pressure and the application endpoint instead of treating a running container flag as application evidence.
Step 2 Failure signatures and limits Narrow the fault
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.
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.
Subtopics
Go one level deeper into this subject.
Namespaces give a container its own view of processes, network, mounts, hostname, users and IPC while it still shares the host kernel.
Subtopic Control Groups (cgroups v2)cgroups limit and account for CPU, memory, I/O and process count for a group of processes; container runtimes place each container in its own cgroup.
Subtopic Container Images and LayersAn image is an ordered set of read-only filesystem layers plus a config describing the entrypoint, environment and user; a running container adds one writable layer on top.
Subtopic Container Isolation and Security DefaultsContainer isolation combines namespaces, cgroups, dropped Linux capabilities, seccomp and an LSM profile; the defaults remove dangerous kernel features but share one kernel.
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.
docker ps -a— containers and exit codesdocker logs <c>— container outputdocker inspect <c>— config, mounts, network, state
ReferenceWhat it is1 section · depth on demand
Operating model
Container Fundamentals explains the execution model behind process containers: an image supplies a filesystem and metadata, a runtime creates an isolated process environment, and the host kernel enforces namespaces, cgroups and other boundaries. Containers are not miniature virtual machines; they normally share the host kernel while keeping selected process, mount, network, IPC and resource views isolated.
ReferenceHow it works1 section · depth on demand
In depth
A container is an isolated process (or group of processes) that runs from an image containing an application and its dependencies. Unlike a virtual machine, it shares the host's kernel; isolation comes from Linux namespaces (what the process can see) and cgroups (what resources it can use). That makes containers start in milliseconds and use far less overhead than VMs.
| Concept | Meaning |
|---|---|
| Image | Read-only template in layers |
| Container | Running instance with a thin writable layer |
| Registry | Stores and distributes images |
| Runtime | Starts and isolates containers (containerd, runc, CRI-O) |
| Orchestrator | Runs containers across many hosts (Kubernetes) |
| Container | VM | |
|---|---|---|
| Kernel | Shared with host | Own kernel |
| Start time | Milliseconds–seconds | Seconds–minutes |
| Isolation | Process-level | Hardware-virtualised |
| Typical use | Applications, microservices, tools | Full OS workloads, strong isolation |
Because the writable layer disappears with the container, persistent data must live in volumes, and configuration should come from environment variables, files or secrets — not from changes made inside a running container.
ReferenceImportant terms & boundaries1 section · depth on demand
Scope map
- Containers vs virtual machines
- Images, containers and runtime state
- Linux namespaces and cgroups
- OCI image/runtime model
- Container lifecycle and exit state
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Image already pulled; the host has cgroup v2. Replace image, user ID and limits with your workload values.
docker run -d --name web \
--user 1000:1000 \
--memory 256m --cpus 0.5 \
--read-only --tmpfs /tmp \
-p 8080:80 \
nginx:1.27-alpineExpected output
docker inspect web --format '{{.State.Status}} {{.Config.User}} {{.HostConfig.Memory}}'Expected state: The container is running as the intended user with the memory limit applied by the runtime.
running 1000:1000 268435456Status shows the process is alive; User and Memory prove the isolation settings were applied. They do not prove the application inside answers requests. Illustrative authored output: field layout matches the tool, values will differ in your environment.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.
Basis: https://specs.opencontainers.org/runtime-spec/ · confidence 92%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Container Fundamentals verification boundary matrix
A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for Container Fundamentals.
| 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 |
Deep reference
Design & tradeoffs
Scope
Linux owns the deep kernel mechanics; Containers owns how namespaces, cgroups, images and runtime lifecycle combine into an operational container. Virtualization owns hypervisors/VMs.