Multi-Stage Builds
Part of the Docker course
Build a container image for a compiled program the obvious way and you get something startling: a 900 megabyte image whose useful contents are one 8 megabyte file. Everything else is the compiler, the package manager that installed the compiler, the header files, the intermediate object files and the module cache.
It is the difference between a workshop and the chair you made in it. You do not deliver the chair by shipping the workshop with the chair inside it. You take the chair out. ...
Want to learn Docker Multi-Stage Builds in a real environment?
Click below, get a fresh Linux box with Docker ready to go, and work through Multi-Stage Builds hands-on with an AI tutor that knows your code.
Start this lessonMulti-Stage BuildsWhat you'll learn
- Build stage
- Runtime stage
- --from=builder
- Slim final images
- AS aliasing
Read this lesson in your language
All lessons in this course
13 lessons- 1What Is Docker20 min
- 2Your First Container25 min
- 3Images and the Dockerfile30 min
- 4Building Custom Images35 min
- 5Container Networking30 min
- 6Volumes and Persistence30 min
- 7Docker Compose35 min
- 8Multi-Stage Builds35 min
- 9Environment Variables and Secrets25 min
- 10Healthchecks and Restart Policies25 min
- 11Image Optimization and Security30 min
- 12Registries and Publishing25 min
- 13Capstone: Shipping a Stack50 min
