Containers
kuhn-TAY-nerz
Lightweight, portable packages that bundle application code with all its dependencies.
Containers are lightweight packages that bundle application code with everything it needs to run: libraries, system tools, configuration files, and runtime. A containerized application runs the same way on a developer's laptop, in CI, on staging, and in production. No more "works on my machine."
Containers solve the dependency problem. An application might need Python 3.11, a specific version of PostgreSQL client libraries, and a particular system tool. Instead of installing all this on every server, you package it once in a container image and run that image anywhere.
Docker is the most common container tool. You write a Dockerfile that describes how to build the container image: start from a base image, install dependencies, copy your code, set the startup command. The result is a portable artifact that runs identically everywhere.
Examples
A developer containerizes an application.
The Dockerfile starts from a Node.js 20 base image, copies package.json, runs npm install, copies the application code, and sets the start command to node server.js. Building produces a 150MB image. Any machine with Docker can run it identically.
Containers fix an environment inconsistency.
A developer's laptop has Python 3.11 but production has Python 3.9. Code that works locally fails in production because of a syntax difference. After containerizing, both environments use the exact same Python version from the container image. The inconsistency is eliminated.
A company runs multiple applications on one server.
One server runs three containers: a web application, a background worker, and a Redis cache. Each container is isolated with its own filesystem, processes, and resource limits. If the worker crashes, the web app and Redis are unaffected.
In practice
Read more on the blog
Frequently asked questions
What is the difference between a container and a virtual machine?
Virtual machines emulate an entire operating system (heavy, gigabytes in size, minutes to start). Containers share the host OS kernel and package only the application and its dependencies (light, megabytes in size, seconds to start). Containers are more efficient for most application workloads.
Do all applications need containers?
No. Simple applications deployed to platforms like Vercel, Heroku, or AWS Lambda do not need containers because the platform handles the environment. Containers are most valuable when you need consistent environments across development, testing, and production, or when running multiple services on shared infrastructure.
Related terms
The most widely used platform for building, running, and sharing containerized applications.
An open-source system for automating the deployment, scaling, and management of containerized applications.
On-demand computing infrastructure (servers, storage, networking) provided by a third party.
An architecture where an application is built as a collection of small, independent services.
The process of releasing code to servers where users can access it.

Want the complete playbook?
Picks and Shovels is the definitive guide to developer marketing. Amazon #1 bestseller with practical strategies from 30 years of marketing to developers.