cli icon indicating copy to clipboard operation
cli copied to clipboard

fix: partial support multi-platform build with automatic platform args

Open tky2240 opened this issue 4 months ago • 1 comments

Summary

This PR fix missing platform arguments (e.g., $TARGETARCH) for multi-platform builds.

Key Changes

  • Fixed Argument Substitution: Platform arguments are now resolved within the findBaseImage function based on the CLI execution environment or --platform args.
  • Added Base Image Validation: The build will now fail with a error if the base image resolves to a different across the platforms.

How to Test

  • ✅ Confirm a multi-platform build succeeds when using a base image with a platform variable (e.g., FROM ${TARGETARCH}-base).
    • src/test/configs/dockerfile-with-automatic-platform-args/
  • ❌ Verify that a build fails as expected when using base images that are inconsistent across platforms.
    • src/test/configs/dockerfile-with-inconsistent-base-image/

Related Issus

  • https://github.com/microsoft/vscode-remote-release/issues/7582
  • https://github.com/microsoft/vscode-remote-release/issues/9605
  • https://github.com/devcontainers/cli/issues/275

Note

  • This PR is out of scope for Docker Compose.

tky2240 avatar Aug 31 '25 17:08 tky2240

@microsoft-github-policy-service agree

tky2240 avatar Aug 31 '25 17:08 tky2240