Lesson 1 of 6

Why Containers?

Your app works perfectly on your laptop. You hand it to a teammate — it crashes: wrong Python version. You deploy it to a server — it crashes differently: missing system library. Same code, three machines, three behaviors. Every developer has lived some version of this, and the phrase that goes with it — "works on my machine" — is the exact problem containers were invented to kill.

💡 The Bottom Line

A container packages your application together with everything it needs to run — runtime, libraries, system tools, configuration — into one isolated unit that behaves identically on any machine with Docker installed. The environment ships with the app, so there's no separate "set up the server" step to get wrong.

The real problem: environments drift

Code isn't the only input to a running program. It also depends on:

Traditionally, all of that lived on the machine, set up by hand or by scripts that slowly drift out of date. Containers flip it: all of that lives in the container image, declared once, and the machine only needs one thing installed — Docker.

Containers vs virtual machines

Virtual machines solve a similar problem by emulating an entire computer, each with its own full operating system. That works, but a VM is gigabytes big and takes minutes to boot. A container doesn't bring its own OS kernel — it shares the host's kernel and isolates just the process, filesystem, and network view. The result:

🙋 There Are No Dumb Questions

Q: Is Docker the same thing as containers?
A: No — containers are the concept (Linux kernel features like namespaces and cgroups doing the isolation), and Docker is the tool that made them usable: one command to build an image, one command to run it, and a registry to share them. Alternatives like Podman exist and even use the same image format, but Docker is where nearly everyone starts, so that's what this track uses.

⚠️ Watch Out

Containers are isolation, not full security sandboxes — they all share the host's kernel. For running your own apps consistently that's exactly what you want; for running untrusted code from strangers, it's not enough by itself. Keep that distinction in mind and containers won't surprise you.

🔧 Try It Yourself

Install Docker Desktop (Mac/Windows) or Docker Engine (Linux) from docker.com, then verify it works:

docker --version
docker run hello-world

That second command downloads a tiny image and runs it as a container. If you see "Hello from Docker!", your machine can now run anything anyone anywhere packaged as a container — which is the whole point.

✅ Quick Check

What is the key difference between a container and a virtual machine?


Next up: the two words you'll use every day from now on — what an image is, what a container is, and the handful of commands that manage them.

← Back to
Next →