Skip to content

fix: fetch builder image per platform#2589

Merged
jjbustamante merged 3 commits intobuildpacks:mainfrom
ddusht:fix/build-fetch
May 2, 2026
Merged

fix: fetch builder image per platform#2589
jjbustamante merged 3 commits intobuildpacks:mainfrom
ddusht:fix/build-fetch

Conversation

@ddusht
Copy link
Copy Markdown
Contributor

@ddusht ddusht commented May 1, 2026

Summary

When using pack build --platform linux/<arch> against a Docker daemon with containerd storage (io.containerd.snapshotter.v1), the builder image was fetched with Fetch() which returns the manifest list or the host-arch image config. This caused two failures depending on Docker version:

  • Docker 28.x + containerd: NotFound: content digest
  • Docker 29.x + containerd: missing label 'io.buildpacks.builder.metadata'

Both share the same root cause: pack did not scope the builder image config lookup to the requested --platform.

This PR switches the builder image fetch from Fetch() to FetchForPlatform(), which resolves the platform-specific digest from the registry manifest list before pulling — the same fix already applied to lifecycle image fetching (#2467).

Also tracks FetchForPlatformCalls separately in FakeImageFetcher and adds regression tests.

Output

Before

ERROR: failed to build: invalid builder '<builder>': builder '<builder>'
missing label 'io.buildpacks.builder.metadata' -- try recreating builder
ERROR: failed to build: failed to fetch base layers: saving image with ID
"sha256:9664dab..." from the docker daemon: Error response from daemon:
unable to create manifests file: NotFound: content digest sha256:508c4e1...: not found

After

Build proceeds normally when --platform linux/arm64 is specified against a containerd-backed daemon.

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

Related

Resolves #2587
Resolves #2588

@ddusht ddusht requested review from a team as code owners May 1, 2026 18:05
@github-actions github-actions Bot added this to the 0.41.0 milestone May 1, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label May 1, 2026
Signed-off-by: Dushyant Dahiya <dushyantdahiya2@gmail.com>
@ddusht ddusht force-pushed the fix/build-fetch branch from b79c4ed to ea6a8c3 Compare May 1, 2026 18:08
@ddusht
Copy link
Copy Markdown
Contributor Author

ddusht commented May 1, 2026

@jjbustamante is there a way to get this pr prioritized?
this has been a blocker for our company to enable multi-arch support

ddusht and others added 2 commits May 1, 2026 13:19
@jjbustamante jjbustamante modified the milestones: 0.41.0, 0.40.4 May 2, 2026
@jjbustamante jjbustamante merged commit b39620f into buildpacks:main May 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

2 participants