Open vijay-v6 opened 4 years ago
@vijay-v6 : I'm not sure if I understood your use case properly. Do you mean having a multi module project and building separate images for each module?
@rohanKanojia Let me explain it in detail. The initial step we used to publish artifacts from a Jenkins jobs is use mvn by default for publish war files, the docker build & push commands to publish docker images and helm client to publish helm charts. Now we want to achieve building and publishing docker images from mvn itself using fabric plugin. In Jenkins when it comes to docker stage, the multiple image building happens in parallel using parallel {} and so does the push off them. Is there a way to achieve the same in mvn build for docker images?
You can put each Docker build into an own Maven submodule (which must not depend on each other) and then run a parallel Maven build like described in https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3
Haven't tried that, but it should work ootb imo.
@rhuss when building in parallel, there is a warning the plugin isn't marked as @threadSafe I think verifying this plugin is thread-safe and marking it with the @threadSafe annotation should do the work.
I agree with @kobynet
I have experienced the same issue and I cannot efficiently use parallel builds because the plugin is failing in a non-deterministic fashion.
I am also creating multiple Docker images under a single Maven artifact and I disagree with re-structuring the projects to produce each Docker image under different Maven artifact (sub-modules) because it feels very messy and inconvenient, at least for my projects.
Also, it is not just about marking the respective classes with @threadSafe
but more importantly making the implementation thread safe.
Is there any possibility of supporting thread safety?
I would also like to have some thread-safety guarantees for this plugin. I can't enable parallel execution in good faith for my production builds, when maven prints this huge warning :/
If someone familiar with the whole codebase could co-ordinate a thread-safety per-class hunting, I could participate, but I can't organize such a thing because I'm quite new to this project
I totally understand your concerns and use case, but I don't have the spare cycles to investigate this deeper. However, if anyone is willing to pick up the task to make this plugin thread-safe, I'm happy to support the integration, e.g. by reviewing and merging a fix. It's just not realistic anymore that I can provide this.
Will have a look if I can help...
But I must wait for my lunar new year vocation, starting from 2022/01/27
I've been building multiple docker images parallel in from a single jenkins jobs.
If I'm going to use the docker-maven-plugin from Jenkins and I want to achieve the same in the maven stage is it possible? Or the mvn execution does the docker image building sequentially only?
Thanks!