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
Cloud Computing Applications, Part 1: Cloud Systems and InfrastructureUniversity of Illinois at Urbana-Champaign via Coursera Introduction to Cloud Infrastructure Technologies
Linux Foundation via edX Introduction aux conteneurs
Microsoft Virtual Academy via OpenClassrooms The Docker for DevOps course: From development to production
Udemy Windows Server 2016: Virtualization
Microsoft via edX