Skip to content

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

dockerfile
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

  1. Write a Dockerfile describing your application environment.
  2. Run docker build to create an image from the Dockerfile.
  3. Run docker run to start a container from the image.
  4. Use docker ps to list running containers and docker logs to 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.

View errors

← Back to glossary