Clipper Speeds Docker Builds 7x With Lazy Layer Pulling
Clipper, a custom BuildKit driver, exports cache mounts that ephemeral CI runners discard and skips unused runtime files, cutting Docker build times up to 7x.
A common pain point in Docker/BuildKit workflows is that cache mounts created with --mount=type=cache are silently discarded on ephemeral builders like GitHub Actions, since BuildKit offers no native way to export them. On top of that, many base images bundle files that are only needed at runtime, not during the build, wasting bandwidth on every pull. A custom BuildKit driver and registry called Clipper tackles both issues, delivering over a 7x speedup when building llama.cpp.
Instead of standard OCI tarball layers, Clipper stores a per-file table-of-contents (TOC) plus separate data blobs. This means metadata-only changes don't force a full new layer, file data can be shared across layers, and large-file extraction can proceed in parallel with other downloads. Because Clipper references content by uncompressed digest, hashes stay stable even across different machines or compression library versions.
On GitHub Actions, enabling lazy layer pulling cut the llama.cpp build from 427 seconds down to 56 seconds — a 7.6x improvement. A separate benchmark running 'uv sync' on an ML dependency set showed Clipper finishing 2.3 to 3 times faster than vanilla BuildKit, with export time in particular dropping from minutes to seconds. For engineers optimizing CI/CD pipelines, these numbers point to a concrete, measurable way to shrink Docker build times.