Closed Amshu-k closed 10 months ago
As a first step, I'll suggest adding ARG VERBOSE=true
to your Dockerfile (prior to RUN features.sh) and see if that provides any additional information about the failure
To run features.sh
in a crossplatform build, I would expect you to be using an emulator such as QEMU in your docker build. This is described in the docker documentation here:
https://docs.docker.com/build/building/multi-platform/#qemu
Can you confirm if that is what you are doing?
Although features.sh is script and hence cross platform, it needs the bash interpreter to run, and the interpreter is not cross platform and will be a native binary inside each container.
Closing as there has been no further updates for 1 month.
Describe the bug
I've a Java project which uses the following Dockerfile:
Usually, to containerize my application, I do the following steps:
mvn clean compile package
docker build -t localhost:myapplication:latest .
This works perfectly fine on my computer which is of archamd64
.I want to create multi-arch image, but I'm running into issues here. I'm doing the following steps:
mvn clean compile package
Docker BuildX
feature to build a multi-arch image (amd64, s390x and ppc64le) with the following command:The image build always fails at this point. (It fails for both ppc64le and s390x), The line
RUN features.sh
doesn't fail for amd64.Steps to Reproduce
mvn clean compile package
docker buildx build --progress=plain --push --platform linux/amd64,linuxs390x,linux/ppc64le -t localhost:myapplication:latest .
Expected behavior
Docker image should be created using Docker BuildX
Diagnostic information:
I suspect that I need to execute the 1st step (
mvn clean compile package
) in the matching architecture for the second step to succeed.My questions: Aren't the files created in the first step architecture agnostic? If not, then we cannot create images for other architectures.