- All Courses
- DevOps with Docker and Kubernetes
- Containers and Images
- Layers, caching, and multi-stage builds
Layers, caching, and multi-stage builds
Instruction order decides your build time. Copy dependency manifests before source, and use a multi-stage build to leave the toolchain behind.
- 7m
- Advanced

Video by Depot · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
What this lesson covers
- Order instructions so the cache survives code changes
- Separate build and runtime with multi-stage builds
- Cut image size and shrink the attack surface
This lesson sits in Containers and Images, part of DevOps with Docker and Kubernetes. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will:
- Order instructions so the cache survives code changes
- Separate build and runtime with multi-stage builds
- Cut image size and shrink the attack surface
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.