Dockerfile Best Practices
Offered By: Docker via YouTube
Course Description
Overview
Learn essential Dockerfile best practices in this 38-minute video from Docker. Explore techniques to optimize image builds, improve caching, and reduce image size. Discover how to effectively use multi-stage builds, manage dependencies, and leverage BuildKit features. Gain insights into creating efficient Dockerfiles for various environments including development, testing, and production. Master strategies to enhance Docker image performance and streamline your containerization workflow.
Syllabus
Intro
Pocket Guide
Quick refresher on Images
Quick refresher on Build
Areas of improvements
Example project
Order matters for caching
More specific COPY to limit cache bust
Line buddies: apt-get update & install
Remove unnecessary dependencies
Use --no-install-recommends
Remove package manager cache
Reuse official images when possible
Use more specific tags
Build from source in a consistent environment
Cache dependencies
Identify build dependencies
Multi-stage builds to remove build deps
Multi-stage usecases
Various environments: build, dev, test, lint,...
Multi-stage: build concurrently
Benchmarks
Supercharged Docker Build with BuildKit
Context mounts (v18.09 only)
Application cache (v18.09 only)
Improvements recap
Taught by
Docker
Related Courses
Startup EngineeringStanford University via Coursera Developing Scalable Apps in Java
Google via Udacity Cloud Computing Concepts, Part 1
University of Illinois at Urbana-Champaign via Coursera Cloud Networking
University of Illinois at Urbana-Champaign via Coursera Cloud Computing Concepts: Part 2
University of Illinois at Urbana-Champaign via Coursera