Skip to main content

Docker

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/docker

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.

At a glance

docker build turns a Dockerfile into a read-only image made of layers; the image can be pushed to and pulled from a registry such as Docker Hub, and each docker run starts a new container from the same image.docker buildpushpulldocker rundocker rundocker runDockerfileFROM node:22COPY . /appRUN npm ciRegistryDocker HubImageread-only templatenpm packagesapp filesnode:22Container 1Container 2Container 3
The image is the template and each container is a running instance of it, so one image can start as many identical containers as you need.

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 appdockerfile
# 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"]

Readers ask

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.

Often compared

See also

Sources

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings