Skip to content

fix(bootstrap): set docker build platform args#1761

Merged
drew merged 1 commit into
NVIDIA:mainfrom
shiju-nv:fix/bootstrap-docker-build-platform-args
Jun 4, 2026
Merged

fix(bootstrap): set docker build platform args#1761
drew merged 1 commit into
NVIDIA:mainfrom
shiju-nv:fix/bootstrap-docker-build-platform-args

Conversation

@shiju-nv
Copy link
Copy Markdown
Contributor

@shiju-nv shiju-nv commented Jun 4, 2026

Summary

Make Dockerfile-based sandbox image builds pass explicit Docker BuildKit platform metadata. It uses TARGETPLATFORM for the requested output image when supplied, falls back to the Docker daemon platform, and seeds the implicit TARGET*/BUILD* build args so Dockerfile behavior does not depend on daemon defaults.

Related Issue

N/A

Changes

  • Query the local Docker daemon platform and normalize Docker-reported architecture names.
  • Set the Docker build request platform from the effective target platform.
  • Seed BuildKit implicit platform args without overwriting caller-provided build args.
  • Avoid injecting empty TARGETVARIANT or BUILDVARIANT values so Dockerfile defaults still work for no-variant platforms.
  • Add unit coverage for native builds, cross-platform builds, architecture normalization, and malformed platform handling.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
    • cargo fmt --check
    • env CARGO_TARGET_DIR=/Users/shiju/.cargo/shared-target cargo test -p openshell-bootstrap
  • E2E tests added/updated (if applicable)
    • Not applicable for this narrowly scoped bootstrap build-argument change; covered by focused unit tests.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)
    • Not applicable; no architecture boundary or user-facing configuration changed.

Docker BuildKit exposes TARGET* for the requested image platform. It exposes
BUILD* for the daemon running build stages. The bootstrap path did not pass an
explicit platform or seed those args, so Dockerfile behavior could depend on daemon defaults.

Set the build request platform from TARGETPLATFORM when supplied. Use the daemon
platform as the fallback. Query the daemon for BUILD*. Seed implicit args without
overwriting caller values. Do not inject empty variant args.

Tests

- mise run pre-commit

Signed-off-by: Shiju <shiju@nvidia.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@shiju-nv
Copy link
Copy Markdown
Contributor Author

shiju-nv commented Jun 4, 2026

I have read the DCO document and I hereby sign the DCO.

@drew
Copy link
Copy Markdown
Collaborator

drew commented Jun 4, 2026

recheck

@drew
Copy link
Copy Markdown
Collaborator

drew commented Jun 4, 2026

/ok to test bfac8a5

@drew drew merged commit 884d4ed into NVIDIA:main Jun 4, 2026
28 of 29 checks passed
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