-
Notifications
You must be signed in to change notification settings - Fork 646
Support / documentation for building multi-arch images (e.g. amd64, arm64) #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After diving into the topic I've got the following:
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<images>
<image>
<name>${docker.push.registry}/myservice:${project.version}</name>
<build>
<buildOptions>
<platforms>linux/amd64,linux/arm64</platforms> <!-- notice platformS here, the API accepts this parameter, in opposite to `docker buildx` that accepts multiple platform in the `platform` parameter`
<version>2</version> <!-- doesn't work -->
</buildOptions> The following exception happens while trying to run the plugin with
Found the ticket #1267 that is a blocker for the problem described. |
I'd like to support that. :-) Since we are working with Intel and M1 Macs, and amd64 architecture docker images are pretty much unusable on my M1 Max, we need to build for both architectures, and that seems to be a serious pain at the moment. |
are the following mvn buildOptions supposed to be working in 0.39.1 now: |
@rvbaron how do i build the image for arm using |
Description
Last versions of docker support multi-arch images (see https://docs.docker.com/engine/reference/commandline/buildx_build/).
For us, multi-arch images become very relevant as developers more and more start to use Apple Silicon (e.g. M1) machines due to their high-performance capabilities.
I was not able to find a way to build the images using the plugin.
Would be good to either add support or if it's possible already now, document it in official docs.
Notes
Tried the following configuration:
The error that I've got is:
The builds using
docker buildx build
ordocker build
with BuildKit enabled, succeeded:DOCKER_BUILDKIT=1 docker build --platform=linux/amd64,linux/arm64 -t myservice .
Environment
mvn -v
) : 3.6.3, Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64The text was updated successfully, but these errors were encountered: