What is Container Image?
Also known as: OCI Image
A container image is a lightweight, standalone, executable package that includes everything needed to run a piece of software: code, runtime, system tools, libraries, and settings. It is the unit of distribution in container ecosystems like Docker and Kubernetes.
A container image is a read-only template composed of a series of layered filesystem snapshots and associated metadata. It is the artifact that bundles an application with all its dependencies, making it portable across different computing environments. Images are built from a set of instructions, typically defined in a Dockerfile or Containerfile, where each instruction creates a new layer. Layers are stored as tarballs and are stacked using union filesystem technologies (OverlayFS in Linux) so that only the changes between layers are stored, enabling efficient storage and transfer.
When a container is started from an image, the runtime adds a thin writable layer on top of the image layers. This means the underlying image remains immutable and unchanged, allowing multiple containers to share the same image without interfering with each other. Images are distributed via registries (such as Docker Hub, Google Container Registry, or private registries) using the OCI (Open Container Initiative) Distribution Specification. Each image is identified by a cryptographic content hash, ensuring integrity and enabling verification of its contents.
Container images sit at the core of the container lifecycle. They provide a standardized, versioned way to package software that decouples the application from the host operating system. This portability allows developers to build, test, and ship their applications consistently from laptops to data centers to cloud environments. The OCI Image Specification (v1.0.0, released July 2017) formalizes the format, laying the foundation for interoperability between different container runtimes and tools.
Key facts
- A container image is a static, immutable bundle of filesystem layers and configuration metadata.
- Layers are created from each instruction in a Dockerfile and are stored as tar archives in an image manifest.
- Images use content-addressable storage; each layer is identified by a SHA-256 digest of its contents.
- The OCI Image Specification (v1.0.0) standardizes the image format for cross-platform compatibility.
- Images are typically pulled from a registry and cached locally for reuse across containers.
How it works in practice
Related terms
References
More in Containers & Orchestration
ConfigMap
A ConfigMap is a Kubernetes API object used to store non-confidential configuration data in key-value pairs, which pods can consume as environment variables, command-line arguments, or configuration files.
Container
A container is a lightweight, isolated runtime that packages an application with its dependencies using OS-level virtualization, enabling consistent execution across environments.
Container Registry
A container registry is a service that stores and distributes container images, enabling developers to push, pull, and version images across environments.
Container Runtime
A container runtime is the low-level software that creates, starts, and stops containers according to the OCI runtime specification, enabling process isolation and resource management.
Docker
Docker is a platform and toolchain for packaging, distributing, and running applications inside lightweight, portable containers, popularising the technology from 2013 onward.
Helm
Helm is a package manager for Kubernetes that uses charts to define, install, and upgrade complex applications as a single, versioned unit.
Ingress Controller
An Ingress Controller is a Kubernetes component that watches Ingress resources and configures a reverse proxy to route external HTTP and HTTPS traffic to services inside the cluster.
Init Container
An init container is a specialized container in a Kubernetes pod that runs to completion before any regular containers start, performing initialization or setup tasks.
Kubernetes
Kubernetes is an open source platform for automating the deployment, scaling, and management of containerized applications across clusters of hosts.
Operator
A Kubernetes Operator is a custom controller that extends the Kubernetes API to automate the management of a specific application, encoding human operational knowledge as code.