Mid-level Track Roadmap

Docker mastery: custom

This course reads the production Dockerfile that rails new generates and explains its decisions. It covers layers, the build cache and multi-stage builds that leave compilers and gem caches behind. Faster builds come from .dockerignore, cache mounts, secret mounts and registry caching in CI. It then turns to smaller and safer images: slim base images, pinned versions, keeping keys out of layers, non-root users and scanning. Final lessons cover runtime behavior (ENTRYPOINT, CMD, PID 1 and signals, health checks, logs) and a custom change with a review checklist.

What you'll learn

  • ✓How layers and the build cache decide what rebuilds
  • ✓Multi-stage builds that ship only finished artifacts
  • ✓Faster builds with .dockerignore, cache mounts and CI caching
  • ✓Smaller, safer images with slim bases, non-root users and scanning
  • ✓Runtime behavior: ENTRYPOINT, CMD, exec, signals and health checks
  • ✓Placing a custom change and reviewing a Dockerfile with a checklist
Free preview · Lesson 1 4 min read

The Dockerfile Rails gave you

rails new writes a Dockerfile. Most developers never open it, deploy with Kamal, and it works. That is a good outcome and a missed opportunity: the file is a compact lesson in production containers, and it is already in your repository.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...