Docker
beginner
~10 hours

Basic Docker

Learn containers, images, networking, and Dockerfile best practices from zero to production-ready.

Chapter 1: Docker Fundamentals

Containers vs Virtual Machines

Containers share the host kernel; VMs include a full guest OS—containers start faster and use less overhead.

Note: Expand this section with your own examples and production notes.

Docker Architecture

dockerd runs containers; containerd manages runtimes; images layer on union filesystems.

Note: Expand this section with your own examples and production notes.

Docker Installation & Setup

Install Docker Engine on Linux or Docker Desktop for local dev.

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
Note: Expand this section with your own examples and production notes.

Chapter 2: Working with Images

Understanding Images

Images are immutable templates; tags point to digests in registries.

Note: Expand this section with your own examples and production notes.

Building Custom Images (Dockerfile)

Multi-stage builds shrink attack surface and image size.

FROM node:20-alpine AS build
WORKDIR /app
COPY . .
RUN npm ci && npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
Note: Expand this section with your own examples and production notes.

Publishing to Registry

Tag with registry URL; push after docker login.

docker build -t myregistry.io/app:v1 .
docker push myregistry.io/app:v1
Note: Expand this section with your own examples and production notes.

Chapter 3: Running Containers

Creating & Running Containers

docker run starts containers; -d detaches; --rm cleans up on exit.

Note: Expand this section with your own examples and production notes.

Container Networking

Bridge networks isolate apps; publish ports with -p host:container.

Note: Expand this section with your own examples and production notes.

Volume Management

Named volumes persist data beyond container lifecycle.

docker volume create app-data
docker run -v app-data:/data myapp
Note: Expand this section with your own examples and production notes.

Chapter 4: Best Practices

Security

Run as non-root; scan images with Trivy; pin base image digests.

Note: Expand this section with your own examples and production notes.

Performance Optimization

Order Dockerfile layers from least to most frequently changed.

Note: Expand this section with your own examples and production notes.

Resource Limits

Set --cpus and --memory to prevent noisy neighbors.

docker run --cpus="1.5" --memory="512m" myapp
Note: Expand this section with your own examples and production notes.