I have several Spring Boot microservices in one parent and I can run spring-boot:build-image to build docker images for all modules. I'm using my Windows WSL2 Ubuntu x86_64 and Docker Engine to build the images through the configuration in IntelliJ.
I'ts all fine and dandy on my Windows machine and I can start the containers successfull, but I want my images to run in containers on my Raspberry Pi Ubuntu Server 21.04 for architecture ARM64 and pull them through my Windows Docker Registry so I can easily transfer images locally. My registry works as well, but then I'm stuck with the error that the image cannot be started due to architecture problems.
How can I change the architecture of the docker image build in the IntelliJ Maven configuration run?
I've found the spring-boot configuration through Maven very convenient, it does all sorts of configuration for building the image. I don't know how to use docker-compose.yml or a Dockerfile to successfull build an image. If this is the answer I will focus my research on this, but up until now I'm quite stuck what to do.
My feeling goes towards the pom.xml and define any configuration there. My pom.xml looks like this right now:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Question edit:
I have seen you can use the parameter --platform=linux/arm64. Can I put this somewhere?