Skip to content

Conversation

tky2240
Copy link

@tky2240 tky2240 commented Aug 31, 2025

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

Note

  • This PR is out of scope for Docker Compose.

@tky2240
Copy link
Author

tky2240 commented Aug 31, 2025

@microsoft-github-policy-service agree

@tky2240 tky2240 marked this pull request as ready for review August 31, 2025 17:37
@tky2240 tky2240 requested a review from a team as a code owner August 31, 2025 17:37
@tky2240 tky2240 marked this pull request as draft August 31, 2025 17:40
@tky2240 tky2240 marked this pull request as ready for review August 31, 2025 19:15
@tky2240 tky2240 changed the title feat: partial support multi-platform build with automatic platform args fix: partial support multi-platform build with automatic platform args Sep 1, 2025
@tky2240 tky2240 force-pushed the tky2240/partial-support-multi-platform-build branch from 48a9b35 to 04a8aa2 Compare September 1, 2025 16:12
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.

1 participant