In short
Your app runs on your laptop but breaks on the server because of a different Node version or a missing library. Containers pack the app with everything it needs, so it runs the same everywhere.
Packaging an application and its dependencies into a portable, isolated container that runs identically anywhere — the technology that made 'it works on my machine' a largely solved problem.

Think of it like this
The packed tiffin box
A tiffin box carries the whole meal: dal, rice, roti, pickle, even the spoon. The delivery man doesn't need your kitchen to serve it. A container image is that tiffin: your code plus its runtime and libraries, ready to open on any machine.
Watch it happen
What happens on docker run
run nginx:1.27
1/6The CLI is just a client. It sends your command to the Docker engine running in the background.
The big ideas
What you need to know
Image vs container
An image is the packed tiffin, read-only. A container is one running copy of it. One image can run as many containers.
Not a virtual machine
Containers share the host's Linux kernel. No full OS to boot, so they start in seconds and use far less memory than VMs.
Isolation by the kernel
Linux namespaces give each container its own view of processes, network and files. cgroups cap its CPU and memory.
Containers are disposable
Anything written inside a container is lost when you remove it. Keep data in volumes, config in environment variables.
See it in code
Walk through the code
1# Pull an image and run it as a container2docker pull nginx:1.273docker run -d --name web -p 8080:80 nginx:1.274 5# See what's running, then read its logs6docker ps7docker logs web8 9# Stop and remove it when you're done10docker stop web && docker rm web1/3-d runs it in the background, --name gives a friendly name, -p maps host port 8080 to the container's port 80.
Open http://localhost:8080 after the run command and you'll see the nginx welcome page, served from inside the container.
Save yourself the pain
Common mistakes
Oops
Using the :latest tag everywhere because it's the default.
Do this instead
Pin a version like nginx:1.27. latest can change under you, so two machines may quietly run different code.
Oops
Treating a container like a pet server: SSH in, install things, edit files by hand.
Do this instead
Change the image instead and recreate the container. Anything done by hand inside disappears on the next deploy.
Your mission
Your first three containers
Quick check
You start three containers from the same nginx image. What does Docker store on disk?
Go deeper
- 1Install Docker and run your first container from a public image.
- 2Learn the difference between an image (a blueprint) and a container (a running instance).
- 3Practice the basic docker commands: run, ps, stop, rm, images.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.