Giter Club home page Giter Club logo

Comments (12)

rohanKanojia avatar rohanKanojia commented on June 2, 2024

@ichasepucks : Thanks for reporting, I'll try to reproduce your issue via some GitHub action mac workflow

from docker-maven-plugin.

ichasepucks avatar ichasepucks commented on June 2, 2024

FWIW, I'm trying to have some colleagues reproduce this. So far, one with an Intel Mac and an old version of Docker, 20.10.12 and Maven 3.8.2 has this working.

from docker-maven-plugin.

boris-prochazka-nentgroup avatar boris-prochazka-nentgroup commented on June 2, 2024

If you look in your build listing you see buildx build --progress=plain --builder multiarch --platform linux/arm64
then later in the push listing you have buildx build --progress=plain --builder multiarch --platform linux/amd64,linux/arm64

I think plugin builds it for a single platform "linux/arm64" and later on it try to push as a multi platform image.

When I look in the plugin sources BuildXService:134 buildAndLoadSinglePlatform() there is only support for single platform at a time, while BuildXService:147 pushMultiPlatform() performs multiplatform push.

I actualy tryied to do a multiplatform build with the maven-plugin with a number of different configuration all accoding to the documentation but never suceeded and I connsider this a bug or a not yet supported fetaure.

from docker-maven-plugin.

boris-prochazka-nentgroup avatar boris-prochazka-nentgroup commented on June 2, 2024

What is needed here i to rewrite the BuildXService:134 buildAndLoadSinglePlatform() to :

    protected void buildAndLoadPlatforms(
            List<String> buildX, String builderName, BuildDirs buildDirs,
            ImageConfiguration imageConfig, String configuredRegistry, File buildArchive
    )  throws MojoExecutionException {
        List<String> platforms = imageConfig.getBuildConfiguration().getBuildX().getPlatforms();

        // "load" of multiplatform builds into the local image repo is not supported by docker v24.0.6
        // single non native platform can be loaded and runed in dockers QEMU emulator
        buildX(buildX, builderName, buildDirs, imageConfig, configuredRegistry,
                    platforms, buildArchive, platforms.size()==1 ? "--load" : null);
    }

This was the easy part, then there are a number of test-cases that needs to be modified and adopted to the fact that multiplatform builds can be done and single platform builds don't need to be native.

from docker-maven-plugin.

boris-prochazka-nentgroup avatar boris-prochazka-nentgroup commented on June 2, 2024

After some iterations I finally understood how the plugin works and have åcome to a conclusion that that is works fine as it is, and reasons for it. The basic reason is that multiplatform images cant be loaded in your local docker repo you have on your machine. It only have support for single platform but it can actualy be a foreign platform. Later on when you run deploy it will rerun buildx ... -push that builds the multiplatform image and pushes it upstreams.

This all works fine for me, so disregards all my previous comments.

from docker-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.