Docker
In one line
Docker is a platform that lets you build, ship, and run applications in containers.
In simple words
Docker is the most popular tool for working with containers. It provides a simple command-line interface to build images, run containers, and manage them.
With Docker, you write a Dockerfile — a text file that describes what goes into your container (base image, dependencies, your code). Then you use the docker build command to create an image, and docker run to start a container from that image.
Docker also provides Docker Hub, a public registry where you can find pre-built images for common software like Node.js, Python, PostgreSQL, and thousands more. You can use these as base images for your own applications.
Example
FROM node:18-alpine
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
CMD ["npm", "start"]This Dockerfile creates a Node.js image: starts from the official Node image, installs dependencies, copies code, and runs the app.
How it works
- Write a Dockerfile describing your application environment.
- Run
docker buildto create an image from the Dockerfile. - Run
docker runto start a container from the image. - Use
docker psto list running containers anddocker logsto view output.
Common confusions
Confused with: Kubernetes
The difference: Docker runs individual containers on one machine; Kubernetes orchestrates many containers across multiple machines.
Related terms
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.