Skip to content

fix: pass build platform to Docker pull to avoid tarball fallback#436

Merged
PedroGuerraPT merged 1 commit intomainfrom
pedro/dep-3616-fix-depot-bake-load-tarball-fallback
Feb 23, 2026
Merged

fix: pass build platform to Docker pull to avoid tarball fallback#436
PedroGuerraPT merged 1 commit intomainfrom
pedro/dep-3616-fix-depot-bake-load-tarball-fallback

Conversation

@PedroGuerraPT
Copy link
Contributor

@PedroGuerraPT PedroGuerraPT commented Feb 23, 2026

Summary

  • When using depot bake --build-platform=linux/amd64 --load on an arm64 Mac, the Docker pull defaults to the host architecture (arm64) and fails with "no matching manifest for linux/arm64/v8", causing a slow tarball fallback
  • The --build-platform flag controls which builder machine is used but was never passed through to the Docker ImagePull call, so Docker didn't know which architecture to request from the registry
  • Adds BuildPlatform to DepotLoadOptions and uses it as a fallback platform when buildOpt.Platforms (the compose platforms field) is empty

Changes

  • pkg/load/cli.go — added BuildPlatform field to DepotLoadOptions; when buildOpt.Platforms is empty and --build-platform is set, pass it as the pull platform
  • pkg/buildx/commands/bake.go — pass buildPlatform through to DepotLoadOptions
  • pkg/buildx/commands/build.go — pass buildPlatform through to DepotLoadOptions

Test plan

  • depot bake --build-platform=linux/amd64 --load on arm64 Mac now pulls with platform="linux/amd64" and avoids tarball fallback
  • Compose files with explicit platforms field still use that value (takes precedence)
  • Same-arch builds are unaffected (no platform override when build platform matches host)

Fixes DEP-3616

@linear
Copy link

linear bot commented Feb 23, 2026

When using --build-platform=linux/amd64 on an arm64 host, the Docker
pull defaulted to the host architecture (arm64) and failed with
"no matching manifest for linux/arm64/v8", causing a slow tarball
fallback. Pass --build-platform as the pull platform so Docker
requests the correct architecture manifest from the registry.
@PedroGuerraPT PedroGuerraPT force-pushed the pedro/dep-3616-fix-depot-bake-load-tarball-fallback branch from a5c248e to a1d6de5 Compare February 23, 2026 18:33
@PedroGuerraPT PedroGuerraPT changed the title fix: pass platform to Docker pull in fast load path fix: pass build platform to Docker pull to avoid tarball fallback Feb 23, 2026
@PedroGuerraPT PedroGuerraPT merged commit 927b769 into main Feb 23, 2026
10 checks passed
@PedroGuerraPT PedroGuerraPT deleted the pedro/dep-3616-fix-depot-bake-load-tarball-fallback branch February 23, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants