Skip to content
Docker build cache

Share Docker layers, package caches, and compiler results.

Keep layer reuse across builds. When an instruction runs again, selected cache mounts and compiler caches can preserve useful work inside it.

Start with shared Docker layer cache.

.boringcache.toml
workspace = "my-org/app"

[adapters.docker]
tag = "docker-cache"
command = ["docker", "buildx", "build", "."]
boringcache docker
permissions:
  contents: read
  id-token: write

steps:
  - uses: boringcache/one@f0fb9b2d926a32b10c543e92093ba00c5a291b79 # v1.33.0
    with:
      mode: docker
      trust-policy: auto
steps:
  - label: Build
    command: >
      boringcache ci run
      --oidc-provider buildkite
      -- boringcache docker
build:
  timeout: 1h
  id_tokens:
    BORINGCACHE_OIDC_TOKEN:
      aud: urn:boringcache:workload
  script:
    - boringcache ci run --oidc-provider gitlab -- boringcache docker

What your build can reuse.

Layers

Reuse an instruction when BuildKit finds matching inputs.

Package caches

Opt in to persistent mounts for downloads and build directories.

Compiler results

Add native tool caching for eligible work inside a rebuilding layer.

Keep the build where it already runs.

The adapter connects your Buildx command to the managed BuildKit backend. BuildKit still decides layer reuse, and your existing runner still runs the build.

See what each Docker build reuses.

See cache reads and transfers for each Docker build.

Explore the workspace →
Workspace insights

Mastodon build cache

GitHub Actionsmainddd4bf7

Open run

Docker and compiler cache reads

0 cache errors

98.3%

113 of 115 cache reads were hits.

Hits
113
Misses
2

Cache data transferred

Restored
1.57 GB
Uploaded
90.1 KB
  • Docker 1.57 GB restored · 90.1 KB uploaded
  • sccache 246 KB restored · 0 Bytes uploaded

Cache activity by tool

  • Docker 101 hits · 2 misses
  • sccache 12 hits · 0 misses

2.9×

Faster Docker builds

Mastodon · compiler and package caches vs. caching disabled

36%

Faster rebuilds

Immich · full cache vs. GHCR layer cache

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

Before you connect.

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 →

Start with your next Docker build.

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

30 GB of cache free. No credit card required.

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