Thuta Learning
Kubernetes
BasicDevOpsIntermediate

Docker vs Kubernetes

KubernetesLesson 2

What you'll walk away with

  • Understand Docker vs Kubernetes without any of the intimidation
  • Get comfortable running kubectl commands and YAML yourself
  • Apply this concept right away in a real project

Take a moment to think about this

Docker is a tool for building/running/shipping a single container — run `docker run` and one container starts up. Kubernetes is a layer that coordinates hundreds of running containers (Docker or containerd) — it manages 'which server should this run on', 'who restarts it on crash', and 'how do containers talk to each other'. Docker Compose is a tool for wiring up multiple containers for local development (kind of like a lightweight version of Kubernetes) — Kubernetes takes that same idea and scales it way up for production.

Let's connect this to a real scenario

When you're building a web app, you write a Dockerfile and build an image with `docker build` (that's Docker's job). If you want to run frontend + backend + database together locally, you can use Docker Compose. But in production, if you want to run 100 containers across 10 servers, load-balance traffic, and move containers off a failed server onto the remaining ones — that's Kubernetes's job.

Let's look at it together

text
Layer                What it does
--------------------------------------------------------
Dockerfile        →  How to build ONE container image
docker run         →  Run ONE container locally
docker-compose.yml →  Run a FEW containers together, locally
Kubernetes         →  Run MANY containers, across MANY servers,
                       self-healing, auto-scaling, production-grade
You should see
You should be able to distinguish the scope of Docker, Docker Compose, and Kubernetes.

5-minute try-it

For a blog site (frontend + backend + database), decide what you'd use for (1) local development and (2) production (10 servers), and write down why.

A quick word of caution

Don't assume that once you install Kubernetes, you no longer need Docker — you still need Docker (or a Docker-compatible tool) for building, tagging, and pushing images.

Easy traps

  • Thinking Docker Compose and Kubernetes are 'the same thing' — Compose is for single-server local dev, K8s is for multi-server production
  • Not realizing Kubernetes needs Docker container images to run at all — K8s doesn't build images, it only runs them

Now try it yourself

For a blog site (frontend + backend + database), decide what you'd use for (1) local development and (2) production (10 servers), and write down why.

You'll know it worked when: You should be able to distinguish the scope of Docker, Docker Compose, and Kubernetes.

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Docker vs Kubernetes | Thuta Learning