Skip to content
Latchkey

Why Slow Image Builds Cost You Money

A build that is two minutes slower than it should be, run a thousand times a month, is over thirty hours of billed compute.

Build time is not just a developer annoyance -- it is a recurring bill and a tax on every merge. This lesson shows how to put a number on slow builds and where the savings come from, including the role of faster managed runners.

Put a number on it

Multiply your per-minute runner cost by the wasted minutes per build, then by builds per month. A pipeline running 1,000 times a month that wastes two minutes each is 2,000 billed minutes -- plus the harder-to-measure cost of engineers waiting on every pull request.

Where the time goes

  • Cold caches that rebuild unchanged layers on every run.
  • Bloated build contexts shipping unnecessary files to the builder.
  • Single-threaded legacy builds that do not parallelize stages.
  • Underpowered runners with slow CPU, disk, and network.

Cut build cost at the source

First apply the techniques from this module: layer-friendly ordering, multi-stage builds, BuildKit cache mounts, and persistent registry cache. These remove work entirely rather than just running the same work faster.

Then run on faster, cheaper runners

Even an optimized build still has to execute its cache-miss steps, and that is bound by raw runner speed. Managed runners that are faster than GitHub-hosted runners -- often at a lower per-minute price -- compress build time and the bill at once. When a build still fails on a transient network or registry hiccup, automatic retries of those flaky failures save a full rerun, which is its own recurring cost. Latchkey provides exactly this: faster, cheaper managed runners with automatic retries for transient CI failures.

Key takeaways

  • Slow builds cost real money: wasted runner minutes multiplied by build frequency, plus developer wait time.
  • Optimize the Dockerfile and caching first to remove work, not just speed it up.
  • Faster, cheaper managed runners with auto-retry of transient failures cut both build time and the bill.

Related guides

See what you would save - Latchkey managed runners with self-healing. Start free →