docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

Multi-Arch Support: Build fails when a builder name was configured

Open Chr3is opened this issue 3 years ago • 4 comments

Description

Following configuration

<plugins>
    <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <configuration>
            <images>
                <image>
                    <build>
                        <buildx>
                            <platforms>
                               <platform>linux/amd64</platform>
                               <platform>linux/arm64</platform>
                            </platforms>
                            <builderName>mybuilder</builderName>
                        </buildx>
                    </build>
                </image>
            </images>
        </configuration>
    </plugin>

leads to this command:

[INFO] DOCKER> docker --config /Users/.../target/docker/.../my-artifact/docker buildx build --progress=plain --builder mybuilder --platform linux/arm64 --tag 0.0.1 --tag latest --tag my-artifact --cache-to=type=local,dest=/Users/.../my-artifact/target/docker/.../my-artifact/cache --cache-from=type=local,src=/Users/.../target/docker/my-artifact/cache /Users/.../target/docker/.../my-artifact/build

which results in this error:

[INFO] DOCKER> error: open /Users/.../target/my-artifact/docker/buildx/instances/mybuilder: no such file or directory [ERROR] DOCKER> Error status (1) when building

Chr3is avatar May 09 '22 10:05 Chr3is

Hi @Chr3is, Are you using the latest release or snapshot version?

viragtripathi avatar May 23 '22 19:05 viragtripathi

Hey @viragtripathi, the builderName configuration was introduced due to this issue: https://github.com/fabric8io/docker-maven-plugin/issues/1551 It wasn't released yet so the bug can only be reproduced on the current master/snapshot

Chr3is avatar May 24 '22 14:05 Chr3is

Thanks @Chr3is I was trying to use the buildx feature for Multi-Arch support following the samples then realized this hasn't been released yet. I guess I will wait for the release.

viragtripathi avatar May 24 '22 15:05 viragtripathi

@viragtripathi It should be available now. Does it work with 0.40.1 for you ?

rhuss avatar Jul 29 '22 14:07 rhuss