Cache broken for cross-architecture builds with DOCKER_BUILDKIT=0 since CVE-2024-24557 #49947
Labels
area/builder/classic-builder
Issues affecting the classic builder
area/builder
help wanted
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
Description
Since the fix for CVE-2024-24557, layer caching no longer works when building container images for a different architecture than the host (i.e. cross-architecture builds) using the classic builder (
DOCKER_BUILDKIT=0
).This regression only affects the classic builder, and can be easily reproduced by comparing Docker versions
25.0.1
(before the fix) and25.0.2
(after the fix) when building images for a non-native architecture (e.g.,--platform=linux/arm64
on anamd64
host).This issue is present in all versions from 25.0.2 onwards, and I have confirmed it is in versions as recent as 28.1.1 (latest as of the creation date of this issue)
Reproduce
✅ Cache Working (Docker 25.0.1)
✅ Second build uses cache as expected.
❌ Cache Broken (Docker 25.0.2)
❌ Second build does not use cache — layers are rebuilt.
Expected behavior
Classic builder should continue to cache layers correctly for cross-architecture builds as it did before the CVE patch, unless explicitly restricted by the user.
Example successful output (from 25.0.1) below:
docker version
Client: Version: 25.0.2 API version: 1.44 Go version: go1.21.6 Git commit: 29cf629 Built: Thu Feb 1 00:22:06 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 25.0.2 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: fce6e0c Built: Thu Feb 1 00:23:45 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.7.13 GitCommit: 7c3aca7a610df76212171d200ca3811ff6096eb8 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
Projects relying on DOCKER_BUILDKIT=0 for reproducible cross-arch builds (e.g., in CI environments or build-once strategies) now suffer from slower builds and unnecessary rebuilds.
The text was updated successfully, but these errors were encountered: