Skip to main content
Lexicon
Lexicon
Docker

Docker

Difficulty: Intermediate
6 min read
Updated 2026-08-19

In plain English

Plain definition

Docker is a platform for packaging an application and everything it needs to run (code, runtime, libraries and configuration) into a single unit called a container. A container behaves like a lightweight, self-contained box: it runs consistently on a developer laptop, a test server or a production host, because the box carries its own contents rather than relying on whatever happens to be installed on the host.

How containers share the host kernel

Docker relies on two Linux kernel features: namespaces for process, network and filesystem isolation, and control groups (cgroups) for resource limiting. With them it runs isolated user-space instances (containers) that share the host kernel rather than running a separate guest kernel as a virtual machine would. A Docker image is a read-only, layered filesystem snapshot built from a Dockerfile; a container is a running instance of that image with a writable layer on top. The Docker Engine (dockerd) manages images, containers, networks and volumes, and exposes this functionality through a client-server API consumed by the Docker CLI and other tooling.

Why reproducible images matter

Docker makes application deployment reproducible: the same image that passed testing is the image that runs in production, reducing configuration drift between environments. That helps build pipelines, keeps local development close to production and makes horizontal scaling easier, since multiple containers from one image can be started or stopped quickly without provisioning full virtual machines. It also hands the team some work that is easy to overlook: image provenance and patching, resource limits per container, log and volume lifecycle management, and network exposure of container ports.

Between the kernel and the orchestrator

Docker sits between the operating system kernel and the orchestration layer. On a single host, Docker Engine is the runtime that creates and manages containers directly. In larger systems, orchestrators such as Kubernetes typically do not use the full Docker Engine themselves; they use a container runtime conforming to the Container Runtime Interface (CRI), which may or may not be Docker-derived depending on the current cluster configuration. Docker images are commonly stored in a registry (public or private) and pulled by hosts or orchestrators at deployment time. Docker networks and volumes provide the connectivity and persistent storage that containers need when the default ephemeral, isolated filesystem is not enough.

Testing an image before you promote it

A common, self-contained task is checking a container image locally before it goes anywhere else:

  1. Build an image from a Dockerfile in an isolated development or CI environment.
  2. Run the resulting image as a container with resource limits and a mapped port.
  3. Inspect the running container’s logs and status to confirm the application started correctly.
  4. Stop and remove the test container once validation is complete, leaving the host state unchanged.

A container is not a small virtual machine

People often describe a Docker container as a lightweight virtual machine. It is not. A container shares the host’s kernel and does not virtualise hardware or run a separate operating system kernel. This is why containers start in a fraction of the time a VM takes, but it is also why kernel-level vulnerabilities or misconfigurations on the host can have a more direct effect on containers than on properly isolated virtual machines. Treating container isolation as equal to VM-level isolation can leave security boundaries weaker than intended.

  • Container image: the read-only template a container is instantiated from.
  • Dockerfile: the declarative build instructions used to produce an image.
  • Container registry: a storage and distribution service for images, such as Docker Hub or a private registry.
  • Kubernetes: an orchestration system that schedules and manages containers, often but not exclusively via Docker-derived runtimes, across multiple hosts.
  • cgroups and namespaces: the underlying Linux kernel mechanisms Docker relies on for resource limiting and isolation.

Further Reading and Verified Operational Checks

Check the installed Docker Engine version and the permissions of the account running Docker commands before you rely on Docker anywhere, since command availability and daemon behaviour can vary by version and by whether the user has been granted access to the Docker daemon socket. Try any container-based workflow in an isolated or non-production environment first.

  • Confirm the Docker daemon is active and responding before treating any container action as reliable evidence of application state.
  • Review resource limits (CPU, memory) assigned to containers rather than assuming defaults are adequate for production-equivalent testing.
  • Treat image provenance as a security boundary: only run images from sources whose build process and contents have been verified.

Once these checks pass, promote the validated image reference (not a rebuilt or changed one) to the next environment stage, so the image is built once and runs the same everywhere.

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.