Skip to main content
Glossary

Docker

A platform for developing, shipping, and running applications in lightweight, portable containers that package code with all its dependencies.

Detailed Explanation

Docker solves the "it works on my machine" problem by packaging applications and their dependencies into containers. Unlike virtual machines, containers share the host OS kernel, making them lightweight, fast to start, and efficient in resource usage.

A Dockerfile defines the steps to build a container image. Running an image creates a container—aisolated process with its own filesystem, network, and process space. Docker Compose defines multi-container applications (e.g., web server + database + cache) and manages them as a single unit. Docker is the foundation of modern containerized deployments and is used with Kubernetes, AWS ECS, and other orchestration platforms.

Why It Matters

Docker is the industry standard for containerization. It is essential for consistent development environments, CI/CD pipelines, and production deployments.

Real-World Example

A development team uses Docker to ensure every developer, the CI pipeline, and production all run the same container image. A bug that appears in production can be reproduced exactly on any developer's machine.

When to Use

For consistent development environments, microservices deployment, CI/CD pipelines, and any situation where you need reproducible, isolated application execution.

Advantages

  • Consistent environments across dev, test, and production
  • Lightweight and fast to start compared to VMs
  • Isolates applications from each other
  • Simplifies CI/CD pipelines
  • Large ecosystem of pre-built images

Disadvantages

  • Adds complexity to simple deployments
  • Container security requires attention
  • Persistent storage requires volume management
  • Debugging inside containers can be challenging
  • Windows containers are less mature than Linux

Frequently Asked Questions

What is the difference between Docker and a virtual machine?

Docker containers share the host OS kernel and are lightweight (megabytes, seconds to start). VMs include a full OS and are heavy (gigabytes, minutes to start). Containers are more efficient but less isolated than VMs.

Do I need Docker for my project?

Not always. Docker is most valuable for complex applications, microservices, team development, and CI/CD. Simple projects or serverless functions may not need it.

What is Docker Compose?

Docker Compose defines and manages multi-container applications using a YAML file. It lets you start an entire application stack (web server, database, cache, etc.) with a single command: docker-compose up.

How do I handle data persistence in Docker?

Use Docker volumes or bind mounts. Volumes are managed by Docker and persist across container restarts. Bind mounts map a host directory into the container. Never store persistent data in the container filesystem.

Is Docker secure?

Containers provide isolation but are not as secure as VMs. Use minimal base images, run as non-root, scan images for vulnerabilities, and use Docker secrets for sensitive data. For production, consider additional security tools.

Back to Glossary

Browse all terms in our software development glossary.

Browse All Terms