Cloud & infrastructuredocker containerlinux namespacesnamespacescontainerisationcontainerization

Container

Definition

A container is a set of ordinary processes that Linux namespaces give their own view of the file system, process tree, network and hostname, and that cgroups limit in CPU, memory and I/O.

In practice

Because no guest kernel boots, a container starts in milliseconds to seconds and costs little memory beyond the app itself, so one host can run dozens of them. That speed and density are what make frequent immutable deploys practical: build a new image, start new containers, move traffic, stop the old ones, and roll back by redeploying the previous digest.

A container is not a small VM. Every container on a host shares one kernel, so a kernel or runtime vulnerability can cross the boundary; untrusted code needs a sandboxed runtime such as gVisor, Kata Containers or a microVM. Anything written to the writable layer disappears with the container, and a restart only restores the image state, so a bug or a tight limit fails again.

Example

A web container runs in its own PID and network namespaces with a 512 MiB memory limit; when a leak pushes it past the limit, the kernel OOM-kills it while the other 30 containers on the host keep serving.