Skip to main content

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?

DockerKubernetes
What it isContainer runtime + build toolContainer orchestration platform
ScopeSingle machineCluster of many machines
RunsIndividual containersGroups of containers (Pods) at scale
Use caseBuild images, run locally, dev environmentsRun thousands of containers in production
AnalogyShipping container standardGlobal port managing millions of containers

Learn Docker first — Kubernetes builds on Docker concepts.


What's Covered

#TopicLevel
01Docker Fundamentals🟢 Beginner
02Writing Dockerfiles🟢 Beginner
03Docker CLI Commands🟢 Beginner
04Docker Networking🟡 Intermediate
05Docker Volumes & Storage🟡 Intermediate
06Docker Compose🟡 Intermediate
07Kubernetes Fundamentals🟢 Beginner
08Pods & Containers🟢 Beginner
09Workloads: Deployments, StatefulSets, Jobs🟡 Intermediate
10Services & Networking🟡 Intermediate
11Storage: PV, PVC, ConfigMaps, Secrets🟡 Intermediate
12Configuration & Resource Management🟡 Intermediate
13kubectl Command Reference🟡 Intermediate
14Helm — Package Manager for Kubernetes🔴 Advanced
15Interview 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

Start here if you're new

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.

Spring Boot users

All code examples in this guide use Java / Spring Boot where application code is shown. The Docker and Kubernetes concepts apply to any language.