Docker: Build and Optimize Docker Images
1h 39mIntermediate2025-08-07
Authors

Shelley Benhoff
Course details
In this intermediate Docker course, author and Docker Captain Shelley Benhoff shows you how Docker’s layer structure and caching mechanism can dramatically speed up your builds and reduce image sizes. Learn to apply best practices for structuring Dockerfiles, incorporating multi-stage builds, and optimizing the build process for security and efficiency. By the end of this course, you will be able to confidently create lean, maintainable images that follow industry-recommended patterns.
Learning objectives
Work with a registry to pull and push images.
Explain how Docker image layers and caching work to optimize builds.
Write a Dockerfile using best practices to create efficient, maintainable images.
Implement multi-stage builds to reduce image size and improve build speed.
Troubleshoot common issues related to the build process and caching.
Learning objectives
Work with a registry to pull and push images.
Explain how Docker image layers and caching work to optimize builds.
Write a Dockerfile using best practices to create efficient, maintainable images.
Implement multi-stage builds to reduce image size and improve build speed.
Troubleshoot common issues related to the build process and caching.
Skills covered
Docker Inc.DockerDevOps ToolsDevOpsProject
Concepts
0. Introduction
- 01 - Understanding Docker images
- 02 - What you should know
1. Introducing Docker Images
- 03 - Comparing Docker images and containers
- 04 - Why image optimization matters
- 05 - Finding official images on Docker Hub
- 06 - Building custom images
- 07 - Challenge - Finding and building images
- 08 - Solution - Finding and building images
2. Organizing Images
- 09 - Why image organization matters
- 10 - Tagging Docker images
- 11 - Labeling Docker images
- 12 - Working with tags and labels
- 13 - Working with an image repository
- 14 - Challenge - Tagging and labeling Docker images
- 15 - Solution - Tagging and labeling Docker images
3. Understanding the Build Cache and Image Layers
- 16 - How Docker builds and layers work
- 17 - Understanding the cache mechanism
- 18 - Excluding unneeded files
- 19 - Building images using caching options
- 20 - Challenge - Working with the build cache
- 21 - Solution - Working with the build cache
4. Using Dockerfile Best Practices
- 22 - Choosing a base image
- 23 - Incorporating basic security practices
- 24 - Combining commands and maintaining readability
- 25 - Challenge - Optimizing a Dockerfile
- 26 - Solution - Optimizing a Dockerfile
5. Working with Multi-Stage Builds
- 27 - Why multi-stage builds matter
- 28 - Setting up a multi-stage build
- 29 - Reviewing multi-stage build output
- 30 - Challenge - Setting up a multi-stage Dockerfile
- 31 - Solution - Setting up a multi-stage Dockerfile
6. Troubleshooting Docker Images
- 32 - Identify common Docker image build errors
- 33 - Using basic debugging techniques
- 34 - Challenge - Debugging Docker images
- 35 - Solution - Debugging Docker images
Conclusion
- 36 - Advancing your Docker skills