A container is a lightweight, standalone, executable package that bundles an application together with everything it needs to run: the application code, a runtime, libraries, and all of its dependencies. Because the package is self-contained and isolated from the host system, the application behaves the same way regardless of where it is deployed. The broader practice of packaging software this way is called containerization, a virtualization method that operates at the operating system level rather than the hardware level.
This approach differs significantly from traditional virtual machines. Virtual machines include a full guest operating system on top of a hypervisor, which makes them larger, slower to boot, and more resource-intensive. Containers, by contrast, share the kernel of the host operating system and only package what is unique to the application. As a result, containers start in seconds and consume far less memory and disk space, allowing many more of them to run on the same physical hardware.
Docker is the most widely adopted platform that implements containerization. It automates the building, deployment, scaling, and management of containerized applications, and it introduces two key concepts that recur throughout the ecosystem. A Docker image is a read-only template containing the application's code, dependencies, libraries, and configuration. A Docker container is a runnable instance created from that image, providing the isolated environment where the application actually executes. Images are typically stored and shared through registries, with Docker Hub being the largest public registry where developers can publish and pull images for reuse.