MainHistoryExamplesRecommended Reading

What is Docker?

Help others learn from this page

Docker helped standardize how we build, ship, and run software — it turned infrastructure into code.
Kelsey Hightower/ Principal Engineer, Google Cloud
image for entry

Docker containers let you package and run apps in isolated environments — like lightweight virtual machines.

Docker is a tool that changed the way developers build and run applications. Imagine being able to ship your app with everything it needs — OS libraries, runtime, dependencies — all bundled into a neat package that runs reliably anywhere. That’s Docker.

It’s the go-to tool for containerization, and it's everywhere: in local development, CI pipelines, production, edge devices, and more.


What It Is — Technically:

Docker is a containerization platform that lets you package an application and its dependencies into a standardized unit called a container. Containers are lightweight, fast to start, and portable across environments.

At the core of Docker is the Docker Engine, which uses features from the host OS (like Linux namespaces and cgroups) to isolate running containers.

How It Works:

  • You write a Dockerfile that describes how to build your app
  • Docker builds a container image from it
  • You run that image as a container using the Docker CLI or Docker Compose
  • The container runs the app in a consistent, isolated environment

Key Features:

  • Portability: Run the same container on any machine with Docker installed — dev, staging, or prod
  • Isolation: Containers run in their own user space and don’t interfere with other processes
  • Efficiency: Containers are more lightweight and faster to start than virtual machines
  • Versioned builds: Each image is immutable and versionable — perfect for CI/CD

Why You’d Use It:

  • Avoid “works on my machine” bugs
  • Standardize deployment across teams and environments
  • Simplify CI/CD pipelines
  • Scale microservices easily in orchestrators like Kubernetes
  • Package legacy apps in a modern format

When Not to Use Docker:

  • If you're building simple desktop or mobile apps with no dependency headaches
  • When full VM isolation is a must (e.g., untrusted code execution)
  • For apps that rely heavily on specific hardware drivers or system-level features

Real-World Example:

Say you're building a Node.js API with a PostgreSQL backend. Instead of setting up Node and Postgres separately on every machine or CI runner, you can define both as services in a docker-compose.yml, and spin them up with a single command. Same environment, everywhere.

Docker empowers teams to think about infrastructure as code, enabling reproducible environments, faster onboarding, and predictable deployments — all with a single Dockerfile.

FAQ

What exactly is a Docker container?
A Docker container is a packaged, runnable instance of your app — with all its dependencies, code, and configuration. It’s like a super lightweight virtual machine that starts in milliseconds.
What’s the difference between Docker and a virtual machine?
VMs emulate entire operating systems and are heavyweight. Docker containers share the host OS kernel and are much lighter, faster, and more portable.
Do I need Docker in production?
Not always — but it helps. Many production platforms (like Kubernetes or AWS ECS) run containers, and Docker lets you build production-ready artifacts that are easy to deploy.
Is Docker only for backend services?
Nope. You can Dockerize frontend apps, databases, message queues — anything you want to package and run consistently.
Is Docker free?
Yes — the Docker Engine and CLI are open source. Docker Desktop has a free tier for personal use, but there are paid plans for teams and enterprises.

Related Stuff

Enjoyed this explanation? Share it!