Docker is a containerization platform maintained by Docker Inc. that packages an application together with all its dependencies โ libraries, runtime, system tools โ into a single portable "container" that runs identically on any machine. It's the most-used dev tool in the world today, reported in roughly 71.1% of developer surveys. Teams reach for it because it eliminates "works on my machine" problems and makes deployment, scaling, and onboarding dramatically simpler.
A Dockerfile describes how to build an image layer by layer. Once built, you run it as a container with a single command.
# Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
# build an image from the Dockerfile in the current directory
docker build -t my-app:latest .
# run it, mapping container port 3000 to host port 3000
docker run -p 3000:3000 --name my-app -d my-app:latest
Install Docker Desktop (Windows/macOS) or Docker Engine (Linux), verify the install, then pull and run any public image from Docker Hub.
# after installing Docker Desktop, confirm it works
docker --version
docker run hello-world
# pull and run an official image
docker run -d -p 8080:80 nginx