The deployment problem
In 2013 deploying an application to production is still a fragile process. Differences between development and production environments — library versions, operating system configurations, implicit dependencies — cause the classic “works on my machine” problem. Virtual machines partially solve the issue, but at the cost of replicating an entire operating system for each application, with boot times measured in minutes and significant resource consumption.
Solomon Hykes presents Docker at PyCon 2013 with a five-minute demo that shifts the industry’s perspective: an application packaged with all its dependencies, running in isolation, started in under a second.
Linux technologies made accessible
Docker invents nothing new at the kernel level. Linux namespaces isolate processes: each container sees its own filesystem, its own processes, its own network, without interfering with others. Cgroups (control groups) limit the resources — CPU, memory, I/O — a container can consume. The union mount filesystem overlays read-only filesystem layers with a writable layer on top, allowing common layers to be shared across different containers.
These technologies have existed for years, but using them directly requires specialist expertise. Docker makes them accessible through a simple command-line interface and a declarative configuration format.
Dockerfiles, images and registries
A Dockerfile is a text file that describes how to build an image: starting from a base image (a minimal operating system), each instruction adds a layer — installing packages, copying files, setting environment variables. The resulting image is immutable and versioned.
Images are distributed through a registry — a centralised repository from which anyone can download ready-to-use images. The public Docker Hub offers official images for the most common software: databases, web servers, programming languages. An organisation can host a private registry for its own images.
The docker run command downloads the image (if not present locally), creates a container and starts it. The application behaves in exactly the same way on any machine running Docker, regardless of the host operating system.
Bridging the gap between development and production
Docker reduces deployment to a deterministic operation: the same image that works on a developer’s laptop works in staging and in production. Dependencies are explicit, isolation is guaranteed, reproducibility is intrinsic to the format. For development and operations teams, Docker eliminates an entire category of problems related to environmental differences.
Link: docker.com
