-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Hi,
So, our use case is we're using pactfoundation/pact-verifier (previously pactfoundation/pact-ref-verifier) as a base image to configure authentication and some values retrieved from our pactflow. The details are maybe not so important, but it means we have a dockerfile that looks like
FROM pactfoundation/pact-verifier:1.3.0
RUN apk add jq curl
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/./entrypoint.sh" ]What is the issue?
Building that on an amd64 machine fails
#5 [2/2] RUN apk add jq curl
#5 0.132 exec /bin/sh: exec format error
#5 ERROR: process "/bin/sh -c apk add jq curl" did not complete successfully: exit code: 255
------
> [2/2] RUN apk add jq curl:
0.132 exec /bin/sh: exec format error
------
Dockerfile:3
--------------------
1 | FROM pactfoundation/pact-verifier:1.3.0
2 |
3 | >>> RUN apk add jq curl
4 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c apk add jq curl" did not complete successfully: exit code: 255
I've created a repo with a minimal reproducible example: https://github.com/bettermarks/pact-verifier-image-bug-repro
And it's possible to see that in these github action logs (link) for as long as GHA keeps those by default.
Have you already got an idea of what might cause that?
I would suspect that the build for both architectures is run on an arm64 machine. And this use of $BUILDPLATFORM causes the amd64 image to have a base image containing aarch64 binaries.
| FROM --platform=$BUILDPLATFORM alpine:3.21 |