# Docker

URL: https://softwaredictionary.org/terms/docker
Category: DevOps & Cloud
Last updated: 2026-09-29

In short: Docker is an open-source platform for packaging an application and everything it needs into a container that runs the same way on any machine.

## What is Docker?

Docker is a tool for building, sharing, and running containers. It packages an application together with its runtime, libraries, and configuration into a single unit, so it behaves the same on a developer's laptop, a test server, and in production. This solves the classic 'it works on my machine' problem.

You describe how to build your app in a text file called a `Dockerfile`. Running `docker build` turns it into an image, a read-only template stored in layers, and running `docker run` starts a container, which is a live, isolated instance of that image. Images are shared through registries such as Docker Hub, and Docker Compose lets you define and start multi-container setups, like an app plus its database, with one command.

Shipping containers inspired the idea: before standardized containers, every kind of cargo needed special handling, but a standard box fits on any ship, train, or truck. Docker images work the same way and run on any machine with a compatible container runtime.

Docker is often confused with containers themselves or with Kubernetes. Containers are the underlying technology, which Docker made popular and easy to use, and images built with Docker follow the open OCI standard, so they also run on other runtimes such as containerd and Podman. Kubernetes is a separate system that runs and manages many containers across a cluster of machines.

## Key takeaways

- Docker packages an application and its dependencies into a container image.
- A `Dockerfile` defines how the image is built.
- An image is the template; a container is a running instance of it.
- Docker Compose runs multi-container applications on one machine.
- Docker images follow the OCI standard and work with other container runtimes too.

## Example: A Dockerfile for a Node.js app

```dockerfile
# Start from an official Node.js base image
FROM node:24-alpine

# Set the working directory inside the container
WORKDIR /app

# Install dependencies first to take advantage of layer caching
COPY package*.json ./
RUN npm ci --omit=dev

# Copy the rest of the source code and define the start command
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
```

## Frequently asked questions

**What is the difference between Docker and a virtual machine?**

A virtual machine emulates a full computer with its own operating system, while a Docker container shares the host's kernel and isolates only the application and its dependencies. As a result, containers are much smaller and start in seconds or less, while virtual machines provide stronger isolation.

**What is the difference between a Docker image and a container?**

An image is a read-only template that contains the application and its dependencies. A container is a running instance created from that image, and you can start many containers from the same image.

**What is the difference between Docker and Kubernetes?**

Docker builds and runs containers, usually on a single machine. Kubernetes orchestrates many containers across a cluster of machines, handling scheduling, scaling, and recovery from failures.

## Sources

- [Docker documentation: What is Docker?](https://docs.docker.com/get-started/docker-overview/)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
