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
Related courses
- Docker for Developers: Create and Manage Docker Containers
- Docker on Azure
- AI Workshop: Advanced Chatbot Development
- Learning Selenium: Structure, Scale, Run, and Optimize Automated Tests
- Advanced Bitbucket Pipelines: Automating Deployments and Managing Third-Party Integrations
- Creating a Book Search Engine from Scratch Using Java and GitHub Copilot
- Learning Docker Compose: Simplified Multi-Container Application Management
- Introduction to Docker for Java Developers
Related learn paths
- MLOps Essentials for Developers and AI Engineers: Tools, Pipelines, Security
- Getting Started with DevOps
- Master Bitbucket
- Technical Program Management
- Master GitHub Copilot
- Advance Your MS SQL Server Skills
- Prepare for the AZ-203 Developing Solutions for Microsoft Azure Exam
- Getting Started with Continuous Integration / Continuous Delivery (CI/CD)