container

A running program that has been fenced off from the rest of the computer so it only sees its own files, network and processes.

In more detail

A container shares the host's operating system kernel but has its own view of files, network and processes, so it starts in moments and is easy to throw away. It is started from an image that bundles the program with everything it needs.

Examples

Ansible can reach containers through a connection plugin, and Molecule commonly uses containers as disposable test instances.
Visual regression suites run their browsers inside one Linux container image so fonts and anti-aliasing match the baselines.
Containers give strong dependency isolation and make running real backing services locally cheap. They do not remove responsibility for health, capacity, security, data and rollback, and a containerised process exits the moment its main process does, which is why twelve-factor processes stay in the foreground.
docker run --rm alpine:3.20 ps -o pid,comm   # one process, PID 1
Production containers here hold only compiled code, run as a non-root user and handle SIGTERM for clean shutdown.
Testcontainers starts a PostgreSQL container for each test class.
Each broker, database and client in the course runs in its own container.
The course stack runs five containers: grafana, loki, otel-collector, prometheus and service.
A shell started inside a container is a classic runtime sensor alert.
In this course: For integration tests a container gives a dependency such as a database a repeatable, disposable home. Start it from a pinned image, wait for it to report ready, and remove it after the test.

Related terms

Taught in

References

Certification courses