Docker & Kubernetes Knowledge Base
Containers changed how we build, ship, and run software. This guide takes you from zero to production β step by step.
The Problem Containers Solveβ
Before containers, deploying software meant:
Developer machine: Java 17, Spring Boot 3, PostgreSQL 15
Staging server: Java 11, different config, PostgreSQL 14 β "works on my machine"
Production server: Java 17 but missing native libs, different OS
Result: unpredictable behaviour across environments
With containers:
One image β runs identically on developer laptop, CI, staging, and production
Dependencies bundled inside the image β no "works on my machine"
Docker vs Kubernetes β What's the Difference?β
| Docker | Kubernetes | |
|---|---|---|
| What it is | Container runtime + build tool | Container orchestration platform |
| Scope | Single machine | Cluster of many machines |
| Runs | Individual containers | Groups of containers (Pods) at scale |
| Use case | Build images, run locally, dev environments | Run thousands of containers in production |
| Analogy | Shipping container standard | Global port managing millions of containers |
Learn Docker first β Kubernetes builds on Docker concepts.
What's Coveredβ
| # | Topic | Level |
|---|---|---|
| 00a | VMs vs Docker vs Kubernetes | π’ Beginner to π΄ Advanced |
| 01 | Docker Fundamentals | π’ Beginner |
| 02 | Writing Dockerfiles | π’ Beginner |
| 03 | Docker CLI Commands | π’ Beginner |
| 04 | Docker Networking | π‘ Intermediate |
| 05 | Docker Volumes & Storage | π‘ Intermediate |
| 06 | Docker Compose | π‘ Intermediate |
| 07 | Kubernetes Fundamentals | π’ Beginner |
| 08 | Pods & Containers | π’ Beginner |
| 09 | Workloads: Deployments, StatefulSets, Jobs | π‘ Intermediate |
| 10 | Services & Networking | π‘ Intermediate |
| 11 | Storage: PV, PVC, ConfigMaps, Secrets | π‘ Intermediate |
| 12 | Configuration & Resource Management | π‘ Intermediate |
| 13 | kubectl Command Reference | π‘ Intermediate |
| 14 | Helm β Package Manager for Kubernetes | π΄ Advanced |
| 15 | Interview Questions | π― All Levels |
Learning Path for Beginnersβ
Week 1 β Docker Basics
ββ Install Docker Desktop
ββ Docker Fundamentals β understand images, containers, layers
ββ Writing Dockerfiles β build your first image
ββ Docker CLI Commands β run, inspect, debug
Week 2 β Docker in Practice
ββ Docker Networking β connect services
ββ Docker Volumes β persist data
ββ Docker Compose β run multi-service apps locally
Week 3 β Kubernetes Basics
ββ Install minikube / kind
ββ Kubernetes Fundamentals β architecture, control plane
ββ Pods & Containers β the basic unit
ββ kubectl Commands β interact with the cluster
Week 4 β Kubernetes in Practice
ββ Workloads β Deployments, scaling
ββ Services & Networking β expose your app
ββ Storage β persist data in K8s
ββ Configuration β ConfigMaps, Secrets
Week 5+ β Production Topics
ββ Kubernetes Security β RBAC, policies
ββ Helm β package and deploy applications
ββ Interview Questions β test your knowledge
Quick Concept Mapβ
DOCKER
Image β Immutable blueprint (layers)
Container β Running instance of an image
Dockerfile β Recipe to build an image
Registry β Store for images (Docker Hub, ECR, GCR)
Volume β Persistent storage for containers
Network β Communication between containers
Compose β Multi-container apps on one machine
KUBERNETES
Cluster β Group of machines running K8s
Node β A single machine (VM or physical) in the cluster
Pod β Smallest deployable unit (1+ containers)
Deployment β Manages replicas of a Pod, handles rolling updates
Service β Stable network endpoint to reach Pods
Ingress β HTTP routing rules into the cluster
ConfigMap β Non-secret configuration
Secret β Sensitive configuration (passwords, keys)
PersistentVolume β Storage provisioned in the cluster
Namespace β Virtual cluster β isolates resources
Helm Chart β Package of Kubernetes YAML templates
Local Setupβ
Install Docker Desktopβ
# macOS β via Homebrew
brew install --cask docker
# Windows β via winget
winget install Docker.DockerDesktop
# Ubuntu / Debian
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER # Add yourself to docker group
newgrp docker # Apply group change
# Verify
docker version
docker run hello-world
Install kubectlβ
# macOS
brew install kubectl
# Linux
curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Verify
kubectl version --client
Install minikube (local Kubernetes)β
# macOS
brew install minikube
# Linux
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Start a local cluster
minikube start --driver=docker --cpus=4 --memory=4g
# Verify
kubectl get nodes
Alternative: kind (Kubernetes IN Docker)β
# macOS/Linux
brew install kind
# Create cluster
kind create cluster --name my-cluster
# Load local image into kind (no registry needed)
kind load docker-image myapp:latest --name my-cluster
Install Docker Desktop, then work through the docs in order starting with Docker Fundamentals. Every topic includes runnable examples β type them out rather than copy-pasting for better retention.
All code examples in this guide use Java / Spring Boot where application code is shown. The Docker and Kubernetes concepts apply to any language.
Interview Questionsβ
Q: How do you explain the relationship between Docker and Kubernetes to stakeholders?β
A: Docker packages workloads consistently; Kubernetes schedules, scales, and heals those workloads in production.
Q: What is the first production concern beyond containerizing an app?β
A: Operational readiness: health checks, resource limits, logging, metrics, and deployment rollback strategy.
Q: Why are immutable images important in modern delivery pipelines?β
A: They guarantee reproducibility across environments and simplify debugging by tying behavior to image version.
Q: How do you reduce deployment risk in Kubernetes?β
A: Use progressive rollout, readiness gates, automated rollback conditions, and clear SLO-based verification.
Q: What is a common anti-pattern when teams adopt Kubernetes early?β
A: Replicating VM-era operational habits without standardizing manifests, observability, and resource governance.
Q: How do you choose between minikube, kind, and managed clusters for workflows?β
A: Use local tools for fast dev feedback and managed clusters for integration, policy, and production-like validation.