You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we used buildx config and set non-native platform only, like <buildx> <platforms> <platform>linux/amd64</platform> </platforms> </buildx>
for as example linux/arm64 (M1 Pro)
Plugin will as second step also build image for the native platform due to
and will fail in our case as PARENT image not availbale for linux/arm64 (openjdk17-alpine)
[INFO] DOCKER> error: failed to solve: openjdk:17-jdk-alpine: no match for platform in manifest sha256:4b6abae565492dbe9e7a894137c966a7485154238902f2f25e9dbd9784383d81: not found
In general we understand rationality for such behavoiur, but it's hard-coded, which make it very hard to use on M1 pro only for package phase for CI/CD.
Can we make it configurable (enabled by default, but with opportunity to disable)
As dirty workaround - we modify Dockerfile, and forcely set FROM --platform=linux/amd64 - but this is not the fancy fix, and destroy all idea of multiarch builds
Info
docker-maven-plugin version : 0.40.1
Maven version (mvn -v) : 3.8.6
Docker version : 20.10.16
If it's a bug, how to reproduce : any buildx config when only non-native platform listed
The text was updated successfully, but these errors were encountered:
voloshanenko
changed the title
Native platform forcely build with buildx config
Native platform image also forcely built with buildx config [native arch forcely added]
Jun 20, 2022
Just ran in to this issue as well, and I don't agree that it makes sense at all, if you configure the platforms you want to build for using the buildx/platform(s) option it should build for those platforms and no other?
Documentation also states: specifying platform to build
A list of <platform> elements specifying platform to build. A platform has syntax of OS/architecture (e.g. linux/amd64, linux/arm64, darwin/amd64).
I'm curious to learn what @chonton's thoughts were when he implemented that. The use-case described by @voloshanenko maybe wasn't on the radar? IMO this shouldn't be a hard-coded behavior.
Description
When we used buildx config and set non-native platform only, like
<buildx> <platforms> <platform>linux/amd64</platform> </platforms> </buildx>
for as example linux/arm64 (M1 Pro)
Plugin will as second step also build image for the native platform due to
docker-maven-plugin/src/main/java/io/fabric8/maven/docker/service/BuildXService.java
Line 102 in f42c906
and will fail in our case as PARENT image not availbale for linux/arm64 (openjdk17-alpine)
[INFO] DOCKER> error: failed to solve: openjdk:17-jdk-alpine: no match for platform in manifest sha256:4b6abae565492dbe9e7a894137c966a7485154238902f2f25e9dbd9784383d81: not found
In general we understand rationality for such behavoiur, but it's hard-coded, which make it very hard to use on M1 pro only for package phase for CI/CD.
Can we make it configurable (enabled by default, but with opportunity to disable)
As dirty workaround - we modify Dockerfile, and forcely set FROM --platform=linux/amd64 - but this is not the fancy fix, and destroy all idea of multiarch builds
Info
mvn -v
) : 3.8.6The text was updated successfully, but these errors were encountered: