Menu

Docker Build Too Slow? 10 Ways to Speed It Up
📰

Docker Build Too Slow? 10 Ways to Speed It Up

DEV Community: cicd·devTalk·about 17 hours ago
#m8PFeyDw
#devtocicd#devto#dev#cache#build
Reading 0:00
15s threshold

A slow Docker build usually has one of a few causes: you are sending far more files to the builder than you need, a cheap change at the top of the Dockerfile throws away an expensive step below it, or every build re-downloads packages it fetched an hour ago. All of these are fixable without changing your application. This article goes through ten fixes in the order I would try them. Most of them I ran and timed on a real Docker Engine, and I show the output, so you can compare it with what you see on your machine.

Step 0: how I tested, and what the numbers mean

Docker Engine 29.8.2, Buildx 0.37.1, BuildKit 0.33.1, on Linux with the containerd image store. The environment could not pull images from Docker Hub, so I built a tiny local base image (a shell plus a few core tools) and used sleep 4 as a stand-in for a slow dependency install.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.