I am trying to build an docker image out of my IntelliJ. It is a Java (openjdk:20) project. I need to have the image as an linux/arm/v7 to run on a raspberry pi 2. But when I try to build the image a get the following error: ERROR: failed to solve: openjdk:20: no match for platform in manifest
When I run docker buildX ls I see that I should be able to build it:
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default docker
default default running v0.11.7-0.20230525183624-798ad6b0ce9f linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
desktop-linux * docker
desktop-linux desktop-linux running v0.11.7-0.20230525183624-798ad6b0ce9f linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
I am using this command:
docker buildx build --platform linux/arm/v7 --tag testarmv7 .
My Dockerfile looks like this:
FROM openjdk:20
ENV ENVIRONMENT=prod
LABEL maintainer="XXX"
EXPOSE 8080
ADD backend/target/capstone.jar app.jar
CMD [ "sh", "-c", "java -jar /app.jar" ]
I really appreciate any help I can get!
I tried to change the jdk to 17, 11 and 8, but it didnt solve the problem.