Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Dockerfile Best Practices

Docker via YouTube

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

Reviews

Start your review of Dockerfile Best Practices

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.