Docker "failed to solve: failed to load LLB" in CI
BuildKit compiles your Dockerfile into a low-level build (LLB) graph before it executes anything. "failed to load LLB" means the builder received a definition it could not decode - a corrupted or truncated LLB blob, a frontend that emitted a malformed graph, or a build context that did not transfer cleanly.
What this error means
A docker buildx build aborts immediately with failed to solve: failed to load LLB, before any RUN step prints output. The Dockerfile itself looks valid.
ERROR: failed to solve: failed to load LLB: unexpected EOFCommon causes
A truncated or corrupt LLB definition
The frontend that compiles the Dockerfile emitted a graph the worker could not decode, often after a partial context transfer.
A mismatched or pinned Dockerfile frontend
A # syntax= line pinning a frontend image that is incompatible with the running BuildKit can produce LLB the worker rejects.
A stale or wedged builder instance
A buildx builder left in a bad state from a prior crashed build can fail to load fresh LLB until it is reset.
How to fix it
Recreate the buildx builder from scratch
- Remove the existing builder and create a clean one.
- A fresh builder loads the LLB graph without inherited corruption.
docker buildx rm mybuilder || true
docker buildx create --name mybuilder --use
docker buildx build -t myorg/api:ci .Pin a compatible Dockerfile frontend
- Set an explicit, current
# syntax=line so the frontend matches your BuildKit. - Avoid floating
:latestfrontend tags that can drift ahead of the worker.
# syntax=docker/dockerfile:1.7
FROM alpine:3.20
RUN echo helloHow to prevent it
- Pin a concrete Dockerfile frontend version with
# syntax=. - Recreate ephemeral builders rather than reusing a wedged one across jobs.