Does Docker Layer Cache actually work?

We have a pretty standard multi-step Dockerfile that we build with a Circle CI machine executor that has DLC turned on.

I’ve been going through our logs and it has literally never cached more than the very first step of the Dockerfile.

Recently I’ve been trying to work out why. We’ve tried plain “docker build”, we’ve tried “buildx” manually, and now we’re trying the aws-ecr build_image action. None of these seem to help with actually getting any benefit from the cache.

I am pretty sure it’s not a cache invalidation issue because the first stage of our build looks like this

# syntax=docker/dockerfile:1.7-labs

FROM node:22-bookworm-slim AS base

RUN apt -qq --allow-releaseinfo-change update && \

  apt -qq install -y openssl curl build-essential python3 && \

  rm -rf /var/lib/apt/lists/*

RUN corepack enable

And none of these steps are ever cached either.

Our environment spin up logs look like this

machine-agent version 1.0.103734-1660c223 (image: “ubuntu-2204:2025.09.1”, public ip: “98.87.6.217”, provider: “EC2”)
Restoring DLC
running command: service [docker stop]
Warning: Stopping docker.service, but it can still be activated by:
docker.socket
success after: 621.725028ms
running command: systemctl [stop docker.socket]
success after: 3.620416ms
Downloading: downloaded 2.408GiB, expanded to 7.086GiB, ratio 0.34, after 31.825424494s.
running command: mount [-t ext4 -o loop,discard /tmp/.dlc.img /var/lib/docker]
success after: 1.454065315s
running command: service [docker start]
success after: 1.263158955s
running command: systemctl [start docker.socket]
success after: 3.199314ms
Restore DLC success after 35.232133308s.
task-agent version 1.0.300544-5528d493
Downloading task-agent: success after 321.2541ms.

And our DLC teardown logs look like this

Saving DLC
running: remove running containers
success after: 248.119365ms
running: prune containers
success after: 461.605µs
running: prune volumes
success after: 1.221527ms
retained 1 buildx volumes:

buildx_buildkit_dlc_builder0_state
running: prune networks
success after: 425.219µs
running: prune images
success after: 24.07736902s
deleted 2 images:

sha256:70ecac72151fee79bcadde6db8ded17ddb867b9ee59cce6d62a84e82656cc8dd

sha256:98fe54396af86d77c17faef0fa68b8627d8bbdf8557d660385634d6da487a142
Resetting cache as it is too large, and risks future builds running out of space
Save DLC success after 26.131987517s.

Note the ominous message about the cache being too large. Our images are about 900MB on the registry which doesn’t seem too huge.

Does this feature actually work for anyone? Am I doing it wrong? Does it not do what I think it’s meant to do?