Skip to content

Don't specify a platform for the parent image#4

Merged
chrisnovakovic merged 1 commit intoplease-build:masterfrom
chrisnovakovic:no-buildplatform
Dec 3, 2025
Merged

Don't specify a platform for the parent image#4
chrisnovakovic merged 1 commit intoplease-build:masterfrom
chrisnovakovic:no-buildplatform

Conversation

@chrisnovakovic
Copy link
Contributor

--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).

`--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).
@chrisnovakovic
Copy link
Contributor Author

chrisnovakovic commented Dec 2, 2025

The CI jobs will fail until please-build/cc-rules#101 is merged - the linux/arm64 image being built here really is arm64 now, and the pleasew script in cc-rules is the outdated one that erroneously downloads the amd64 Please binary on arm64.

@chrisnovakovic chrisnovakovic merged commit b137e08 into please-build:master Dec 3, 2025
0 of 2 checks passed
@chrisnovakovic chrisnovakovic deleted the no-buildplatform branch December 3, 2025 10:21
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