Skip to content
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

fix to add support for multiple docker services #281

Closed
wants to merge 2 commits into from

Conversation

nkrendel
Copy link

I ran across this problem with trying to use the plugin to stop/remove/build/start images on two docker hosts. ServiceHub was only initialized once and so the second docker configuration used the services that were initialized with the old docker url. This is an attempt to fix that.

@rhuss
Copy link
Collaborator

rhuss commented Sep 14, 2015

Interesting use case (which I never thought about ;-). SInce the Docker URL is a plugin-global param, I guess you have a multi-module setup ? Would you mind to post some example for this setup so that I can reproduce it ?

@nkrendel
Copy link
Author

Yes it's a multi-module setup. The root pom defines the plugin and has skip=true. Then there are two sub-modules that each build a war. One sub-module builds the regular api endpoint war and another sub-module builds the admin api endpoint war. These are deployed to different hosts so each sub-module has a configuration with a different dockerHost. e.g.:

                <configuration>
                    <dockerHost>tcp://api-host.company.com:2376</dockerHost>
                    <verbose>false</verbose>
                    <skip>false</skip>
                    <sourceDirectory>src/main/docker</sourceDirectory>
                    <images>
                        <image>
                            <name>wildfly-api</name>
                            <alias>service</alias>
                            <build>
                                <cleanup>true</cleanup>
                                <tags>
                                    <tag>latest</tag>
                                    <tag>${project.version}</tag>
                                </tags>
                                <assembly>
                                    <dockerFileDir>wildfly-api</dockerFileDir>
                                </assembly>
                            </build>
                            <run>
                                <ports>
                                    <port>8080:8080</port>
                                    <port>9990:9990</port>
                                </ports>
                            </run>
                        </image>
                    </images>
                </configuration>

Please let me know if you'd like me to post more pieces from this example.

@rhuss
Copy link
Collaborator

rhuss commented Sep 29, 2015

Thanks, I will tackle the issue for the next (0.13.6) release since its a bit more involved (and needs some extra thoughts)

@rhuss rhuss added this to the 0.13.7 milestone Oct 13, 2015
@rhuss
Copy link
Collaborator

rhuss commented Dec 1, 2015

I refactored the usage of the ServiceHub so it is recreated for each run. Multiple Docker hosts should be now be easily possible. This was added in course of #320 .

I pushed a version 0.13.7-SNAPSHOT with this fix. Could you please check whether this solves your use case ?

@rhuss rhuss added the fixed label Dec 1, 2015
@nkrendel
Copy link
Author

nkrendel commented Dec 2, 2015

Support for multiple docker hosts seems to be working in 0.13.7-SNAPSHOT.

@rhuss
Copy link
Collaborator

rhuss commented Dec 2, 2015

cool. I'll close this PR, feel free to reopen it or create an issue if there are still problems.

@rhuss rhuss closed this Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants