Don't specify a platform for the parent image#4
Merged
chrisnovakovic merged 1 commit intoplease-build:masterfrom Dec 3, 2025
Merged
Don't specify a platform for the parent image#4chrisnovakovic merged 1 commit intoplease-build:masterfrom
chrisnovakovic merged 1 commit intoplease-build:masterfrom
Conversation
`--platform=$BUILDPLATFORM` forces the parent image to have the same platform as the native platform on which the image is built, which in this case is linux/amd64 (because the image is built on GitHub's `ubuntu-24.04` runner image). The "linux/arm64" variant of the image is therefore just Alpine Linux x86-64, which silently works - at least, until you try to run an arm64 binary inside the container - as long as the host has QEMU installed, because it is able to (potentially very slowly) emulate the x86-64 instruction set for the container. Don't force a specific platform in the Containerfile, and trust Docker to choose a platform-appropriate parent image at build time (which it does).
Contributor
Author
|
The CI jobs will fail until please-build/cc-rules#101 is merged - the |
toastwaffle
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--platform=$BUILDPLATFORMforces the parent image to have the same platform as the native platform on which the image is built, which in this case is linux/amd64 (because the image is built on GitHub'subuntu-24.04runner image). The "linux/arm64" variant of the image is therefore just Alpine Linux x86-64, which silently works - at least, until you try to run an arm64 binary inside the container - as long as the host has QEMU installed, because it is able to (potentially very slowly) emulate the x86-64 instruction set for the container.Don't force a specific platform in the Containerfile, and trust Docker to choose a platform-appropriate parent image at build time (which it does).