What is Docker?

The problem Docker solves, containers vs VMs, first command

The Problem Docker Solves

Picture this: a developer writes code on their Windows laptop. It works perfectly. They push it to the server — which runs Linux — and it breaks. The classic phrase follows immediately:

The same problem hits QA engineers constantly. Your test environment has Chrome 120. CI has Chrome 118. The app behaves differently on both. Jenkins has Java 11, your laptop has Java 17. Tests pass locally, fail on the pipeline.

Docker fixes this by packaging your application together with everything it needs to run — the OS layer, the runtime, the dependencies — into one neat bundle called a container. That container runs identically on your laptop, your teammate’s Mac, and a Linux server in the cloud.

The Shipping Container Analogy

Before shipping containers existed, loading a ship was chaos. Each item had a different shape. Boxes, barrels, animals, fabric rolls — everything needed to be loaded differently, stacked differently, and unloaded differently. Ships took days to load.

Then someone invented the standardised shipping container. Now it does not matter what is inside — electronics, bananas, furniture. The container is always the same size, has the same corners, fits the same cranes. You can load a ship in hours.

That is literally where Docker got its name and its whale logo. The whale carries containers (boxes) on its back.

Container vs Virtual Machine

You may have heard of Virtual Machines (VMs). They also let you run software in an isolated environment. What is the difference?

Virtual MachineDocker Container
Includes a full operating system (GB in size)Shares the host OS kernel (MB in size)
Takes minutes to startStarts in seconds
Heavy on RAM and CPUVery lightweight
Great for running a different OS entirelyGreat for running apps consistently

Think of a VM as buying a new house for each guest. A container is more like giving each guest their own room in the same house. Much cheaper, much faster.

Three Terms You Must Know

Docker uses three words everywhere. Learn these once and everything else makes sense.

Install Docker

Download Docker Desktop — it includes everything you need and comes with a GUI. It is free for personal use.

  • Windows / Mac: Download Docker Desktop from docker.com/products/docker-desktop
  • Linux: Install Docker Engine via your package manager (apt, yum, etc.)

After installing, open a terminal and check that it works:

docker --version

You should see something like:

Docker version 26.1.0, build a5ee5b1

Your First Docker Command

Docker ships with a special image called hello-world — designed exactly for this moment. Run this:

docker run hello-world

The output will look like this:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
...
Hello from Docker!
This message shows that your installation appears to be working correctly.

Let us read that output together — every line tells a story:

Output lineWhat it means
Unable to find image locallyDocker looked for the image on your machine first — not found
Pulling from library/hello-worldDocker downloaded the image from Docker Hub automatically
Hello from Docker!A container was created from the image and ran successfully

That is the whole Docker flow in one command: find image → download if missing → create container → run it. You will repeat this pattern for every Docker command you ever use.

What You Just Learned

  • Docker solves the “it works on my machine” problem
  • A container is a lightweight, isolated environment for running software
  • An image is the blueprint; a container is the running thing
  • Docker Hub is where images live
  • docker run does everything in one step: pull, create, run

Next up: learn where images come from, how to find what you need on Docker Hub, and how to manage images on your machine.