cli
cli copied to clipboard
fix: partial support multi-platform build with automatic platform args
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
findBaseImagefunction based on the CLI execution environment or--platformargs. - 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.
@microsoft-github-policy-service agree