Skip to content
Docker build cache

Docker build cache.
Reuse more than layers.

Keep Docker layers, package downloads, and compiler results between builds. When your code changes, reuse the work that still matches, on your laptop or your CI runners.

What Docker can reuse
Base image Matching layer
Install dependencies Matching layer
Build application Source changed

The instruction runs. Inner caches can still match.

Tool results

Compiler and task outputs

Package caches

Downloads already stored

Reuse work even when a Docker layer rebuilds.

Docker layers

Skip a Dockerfile instruction when BuildKit finds matching inputs and a cached result.

Package downloads

Keep pnpm, npm, or uv downloads between builds with opt-in persistent cache mounts.

Compiler and task results

Reuse matching ccache, sccache, Go, or Turborepo results inside an instruction that runs again.

Keep the build where it already runs.

Keep your Dockerfile and build on your existing runners. Start with shared layers, then add the tool caches and mounts your build needs.

Keep your tool caches inside Docker.

A source change can make a build instruction run again. Your compiler, build tool, and package manager can still reuse their own cached work, even on a fresh builder.

Add native tool caching for matching results. Persist cache mounts for downloads and directories you want to keep between builds.

Configure Docker layers and inner caches →

Compiler and task results

ccache · sccache · Go · Turborepo

Read matching results from native tool caches.

Package downloads

pnpm · npm · uv

Restore selected Dockerfile cache mounts.

See what each Docker build reuses.

See cache reads and transfers for each Docker build.

Explore the workspace →
PostHog · Workspace insights
Cache hits

BoringCache · GitHub runner · 4 vCPU

98.5% of 2,486 lookups over 30 builds

Docker benchmark

All Docker results →

Build times grouped by runner, with cold and warm builds shown separately.

Compare PostHog build times by runner

PostHog

Docker

Benchmark →

Product analytics platform. One Docker image with the Django backend and Node.js frontend.

Average restore, build and save · lower is better

GitHub runner

4 vCPU · 16 GB · Ubuntu 24.04 x86-64

Base · Image layers

BoringCache
15 min 2 s 30 builds
GHA Cache
28 min 22 s 30 builds
GHCR
20 min 58 s 30 builds

Plus · Image layers, tool caches and cache mounts

BoringCache +
18 min 1 s 30 builds
GHA Cache Dance
41 min 8 s 30 builds
Same CPU model

Builds of one commit can land on different CPU models. These ratios use only the build pairs where both caches ran on the same model; above 1.00× means BoringCache's total time over those pairs was lower.

GHA Cache vs BoringCache
1.96× · 10 of 30
GHCR vs BoringCache
1.39× · 7 of 30
GHA Cache Dance vs BoringCache +
2.32× · 11 of 30
6 CPU models recorded
BoringCache · Image layers
AMD EPYC 7763 (16 builds) · AMD EPYC 9V74 (10 builds) · AMD EPYC 9V45 (3 builds) · Intel Xeon Platinum 8370C (1 build)
BoringCache + · Image layers, tool caches and cache mounts
AMD EPYC 7763 (12 builds) · AMD EPYC 9V45 (8 builds) · AMD EPYC 9V74 (7 builds) · Intel Xeon Platinum 8573C (2 builds) · Intel Xeon Platinum 8370C (1 build)
GHA Cache · Buildx type=gha, mode=max
AMD EPYC 7763 (15 builds) · AMD EPYC 9V74 (8 builds) · AMD EPYC 9V45 (4 builds) · Intel Xeon Platinum 8573C (2 builds) · Intel Xeon 6973P-C (1 build)
GHCR · Buildx type=registry, mode=max
AMD EPYC 9V74 (13 builds) · AMD EPYC 7763 (9 builds) · AMD EPYC 9V45 (5 builds) · Intel Xeon Platinum 8370C (2 builds) · Intel Xeon Platinum 8573C (1 build)
GHA Cache Dance · type=gha, mode=max; cache mounts saved by actions/cache
AMD EPYC 7763 (18 builds) · AMD EPYC 9V74 (5 builds) · AMD EPYC 9V45 (2 builds) · Intel Xeon Platinum 8370C (2 builds) · Intel Xeon Platinum 8573C (2 builds) · Intel Xeon 6973P-C (1 build)
Cold and warm builds

Each table is one workflow run with one build per cache. A row marked Different CPU ran on another CPU model than BoringCache at the same level, so part of its time difference can come from the hardware.

One cold and warm build per cache
Cache Cold Warm CPU
Base · Image layers
BoringCache Image layers 15 min 28 s 2 min 13 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V74
Plus · Image layers, tool caches and cache mounts
BoringCache + Image layers, tool caches and cache mounts 16 min 29 s 3 min 4 s Cold: AMD EPYC 7763 · Warm: Intel Xeon Platinum 8573C
One cold and warm build per cache
Cache Cold Warm CPU
GHA Cache Buildx type=gha, mode=max 39 min 59 s 3 min 6 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V74
GHCR Buildx type=registry, mode=max 23 min 24 s 2 min 44 s AMD EPYC 7763
GitHub Arm runner

4 vCPU · 16 GB · Ubuntu 24.04 Arm64

Base · Image layers

BoringCache
11 min 57 s 30 builds
GHA Cache
21 min 19 s 30 builds
GHCR
16 min 10 s 30 builds

Plus · Image layers, tool caches and cache mounts

BoringCache +
15 min 22 s 30 builds
GHA Cache Dance
34 min 13 s 30 builds

Neoverse-N2

Cold and warm builds

Each table is one workflow run with one build per cache. A row marked Different CPU ran on another CPU model than BoringCache at the same level, so part of its time difference can come from the hardware.

One cold and warm build per cache
Cache Cold Warm CPU
Base · Image layers
BoringCache Image layers 12 min 51 s 2 min 20 s Neoverse-N2
Plus · Image layers, tool caches and cache mounts
BoringCache + Image layers, tool caches and cache mounts 12 min 32 s 2 min 18 s Neoverse-N2
One cold and warm build per cache
Cache Cold Warm CPU
GHA Cache Buildx type=gha, mode=max 26 min 41 s 2 min 39 s Neoverse-N2
GHCR Buildx type=registry, mode=max 16 min 37 s 2 min 15 s Neoverse-N2
Cache hits

BoringCache · GitHub runner · 4 vCPU

98.5% of 2,486 lookups over 30 builds

Keep shared-cache publication in trusted jobs.

Give consumers restore access and publishers a separate permission. Connect supported CI through OIDC or use scoped credentials.

Connect your CI →

Separate readers and publishers

  • Trusted builds Publish shared cache for the next build Read + publish
  • Pull requests Restore cache without replacing it Read only
  • Local development Use a scoped credential for the workspace Scoped access

Common questions

Does BoringCache replace Docker BuildKit cache?
BoringCache adds a native BuildKit cache backend. BuildKit still decides cache hits and misses.
Do I need to move my Docker builds?
No. Builds keep running on your existing CI runners and local machines. The adapter configures the managed BuildKit backend.
Can local Docker builds reuse CI cache?
Yes. Use the same workspace with restore access. BuildKit reuses layers whose inputs match.
Can I keep Docker's no-cache behavior?
Yes. Keep --no-cache or cache:false to rerun every instruction, and enable persistent cache mounts or native tool caching for work inside those instructions.
Read the Docker setup guide →

Can I help with your build?

Send me a repo or a workflow and I'll take a look. I've spent more than a year on slow Docker, Cargo and Bazel builds in CI.

Get help with your build

Set up Docker caching

Install the CLI. Run onboarding to connect your repository and configure your cache.

30-day trial. No credit card required.

curl -sSL https://install.boringcache.com/install.sh | sh
boringcache onboard
boringcache docker