Docker for CI/CD
A focused course on using Docker in CI/CD pipelines.
Learn to use Docker in CI/CD: write good Dockerfiles, build and cache images fast, push to registries, use service containers for tests, and ship containers to production - all from your pipeline.
Module 1 - Docker basics for CI
Images, Dockerfiles, and the build context.
Why Containers in CIContainers make CI/CD reproducible by shipping the same environment from a developer laptop to the pipeline t…
Images vs ContainersThe difference between an image, a container, and a Dockerfile -- the three core concepts you need before bui…
First DockerfileA step-by-step walkthrough of a clean, CI-friendly Dockerfile -- choosing a base image, copying code, install…
Build ContextWhat the Docker build context is, why a bloated context slows CI, and how a .dockerignore file keeps builds f…
Image TaggingHow to tag images built in CI: immutable digests, commit SHAs, semantic versions, and moving tags like latest…
Containers in ActionsThe three ways to use containers in GitHub Actions: container jobs, service containers, and running images yo…
Compose in CIUse Docker Compose to stand up multi-service integration tests in CI: define services, wait for health, run t…
Module 2 - Building & caching in CI
BuildKit, layer caching, multi-stage, multi-arch.
Layer CachingHow Docker decides whether to reuse a cached layer or rebuild it -- the cache key rules that make or break yo…
BuildKit & buildxBuildKit and buildx unlock parallel builds, cache mounts, and remote caching -- the modern way to build Docke…
GHA Layer CacheTwo ways to persist Docker layer cache across GitHub Actions runs: the gha cache backend and registry cache -…
Multi-Stage BuildsMulti-stage Docker builds separate the build toolchain from the runtime, producing tiny, secure final images.…
Multi-Arch ImagesBuild images that run on both amd64 and arm64 from one CI workflow using buildx, QEMU emulation, or native mu…
Smaller, Faster BuildsPractical techniques to shrink Docker images and cut build time in CI: smaller bases, fewer layers, cache mou…
Slow Builds Cost MoneySlow Docker builds burn billable runner minutes and developer time on every commit. Here is how to quantify t…
Module 3 - Registries & shipping
Push, scan, and deploy container images.
Choosing a RegistryCompare GitHub Container Registry, Docker Hub, Amazon ECR, and Google Artifact Registry to pick the right hom…
Pushing ImagesThe full build-tag-login-push flow for shipping a Docker image from CI to a registry, with working GitHub Act…
Registry AuthAuthenticate CI to container registries without leaking secrets: scoped tokens, OIDC keyless auth, and least-…
Image ScanningCatch known CVEs before they ship by scanning Docker images in CI with tools like Trivy -- and gate the pipel…
Signing & ProvenanceSign Docker images with cosign and attach build provenance so consumers can verify an image came from your pi…
Deploy to ProdTake a pushed image to production safely: deploy by immutable digest, roll out gradually, run health checks,…
Image PromotionPromote the same image artifact through dev, staging, and production instead of rebuilding -- the safest path…
Explore other topics
GitHub ActionsWorkflow, runner, and YAML errors - diagnosed and fixed.
Node.js & npmnpm, yarn, and pnpm failures in CI - solved.
DockerBuild, run, compose, and registry errors - explained.
Pythonpip, poetry, venv, and pytest failures - fixed.
Java & JVMMaven, Gradle, and JVM failures in CI - resolved.
GoGo build, module, and test failures - diagnosed.