-
Notifications
You must be signed in to change notification settings - Fork 642
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
Support for docker-compose #57
Comments
Docker compositions looks like the one to go for in my opinion? Another feature to consider in that regard is producing a Docker composition |
Yes, I also think to fully support Creating a |
The use case I have would be something like
I believe the approach is in the spirit of both Maven and Docker? |
I have successfully tested docker-compose release 1.1.0-rc2 https://github.com/docker/fig/releases/tag/1.1.0-rc2. Good time to start implementation....How I can help? |
has any thought been given on how this type of configuration could be exported into a maven repository so it could be imported into another pom? i thought i saw something about that floating around but i can't seem to find it now. |
Has some work been done here? I would be very interested in this feature. Plugin beeing able to start container based on docker-compose.yml file. This way I wouldn't have to keep updated both my pom.xml for my automated integration tests and a docker-compose.yml file for my productive environment. |
no - nothing by us to my knowledge at this point. some where there is another issue floating around where someone stated they had an implementation of this in a forked project. we were hoping they'd contribute it back (even if it was rough around the edges) but i'm not sure where that conversation left off. i'll see if i can dig up the ticket, if @rhuss doesn't find it first, and reach back out. |
oh - duh - said issue is #273 referenced above. |
i'm going to pick this up, there is already support for this using properties files, so all that should be needed to provide a basic level of support is a yaml parser. |
so i figured i should drop this here for feedback before i potentially get to far... adding here's what the new config looks like (more or less) <plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<external>
<compose>
<dockerComposeDir>kafka-docker</dockerComposeDir>
<extended>
<service>
<id>zookeeper</id>
<wait>
<time>1000</time>
</wait>
</service>
<service>
<id>kafka</id>
<wait>
<time>1000</time>
</wait>
</service>
</extended>
</compose>
</external>
</image>
<image>
<external>
<properties>
<prefix></prefix>
<propertyFile></propertyFile>
</properties>
</external>
</image>
<image>
<external>
<other>
<type>foo</type>
<configuration>
<name>value</name>
</configuration>
</other>
</external>
</image>
</images>
</configuration>
</plugin> external properties have been moved to their own configuration section (w/ a future enhancement to allow those props to live in a file) and anyone can still add a handler of their own choosing using the since also - the first cut of this support will not support building containers. there are some open questions regarding how best to support that, some of which is slated to be supported in the |
sounds good to me. I like the idea to use dedicated tags for other kinds of configuration so that we could have a better XSD support for IDE completion (which I want to add soon). Frankly, I'm not so keen on the external property configuration since it adds quite some maintenance burden to not forget to new config options there, too. Maybe we can get even rid of the Some random remarks:
|
i don't think the part of me thinks we should ditch the configuration that supports an arbitrary map b/c are ppl really using some other external format then as to your remarks... i can change p.s. i did not forget about #87, that's been getting love during work day hours. should have something for that in the next couple of days. |
The colleague interested in the feature will post directly his use case here. |
i have a beta version of this that you can try out, just use the following version in your pom:
there is support building and running containers, with the following exceptions:
the plugin configuration now looks like this for the <plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<external>
<properties>
<prefix>prefix</prefix>
<propertyFile>path/to/propertyFile</propertyFile>
</properties>
</external>
</image>
<image>
<external>
<compose>
<basedir>src/main/docker</basedir>
<yamlFile>kafka-docker/docker-compose.yml</yamlFile>
<services>
<service>
<image>issue-57-compose-test:${project.version}</image>
<alias>zookeeper</alias>
<build>
<cleanup>true</cleanup>
<nocache>false</nocache>
<compression>gzip</compression>
<skip>false</skip>
</build>
<run>
<portPropertyFile>/tmp/issue-57-compose-test.properties</portPropertyFile>
<wait>
<time>1000</time>
</wait>
<skip>false</skip>
</run>
</service>
</services>
</compose>
</external>
</image>
</images>
</configuration>
</plugin> if you notice, the configuration likes almost identical to what you'd define in the pom w/ the exception of the
compose configurations which require a random port will automatically have a
will place the container port into a property named i still have to finish tests and documentation, but i'll throw up a PR to at least get a review going. comments, feedback are welcome... p.s. i tested this against |
Is it released? |
sorry, not yet. But its next the roadmap along with Dockerfile enhancement. Initial work has been done by @jgangemi in #384, need to finish integration thouhgh. Unfortunately I'm currently busy with other work until easter, but will continue work on this after this. The new milestone will be 0.15.0 (since some major changes are expected), I will update the roadmap accordingly. |
Noticed it's been a few more months, is this being actively developed? Looks like a very useful feature, in particular if "extends" support is added as well https://docs.docker.com/compose/extends/#/extending-services |
There is work going on, unfortunately a bit slow. The changes are tracked in a dedicated branch https://github.com/fabric8io/docker-maven-plugin/tree/384-compose (the original PR is #384). So it will eventually end up in this plugin, not quite sure when (although we quite close). There is still some discussion how to add d-m-p specific feature configuration to either the compose file as extension or as part of the d-m-p xml configuration (as it is at the moment) Thats however only for the direction compose -> d-m-p (i.e. a compose file as configuration for d-m-p). The work on implementing the creation of a compose file from d-m-p configuration has not yet started, though. That said, docker compose's If you are interested, we happily integrate contributions, too. If so, I could elaborate a bit was is still missing on #384 to make it into one of the next releases. |
I'm investigating your docker-maven plugin for use in my projects but I'm a bit put off by the need to duplicate my compose file in the pom.xml. What's the status of this feature? |
it works - what specifically do you find yourself needing to duplicate? |
I had thought that this issue was still open. I have a compose file that that I use for running my service and linking it to dependent services. I'd like it if I didn't have to replicate this in my pom.xml for running tests. |
you shouldn't need to duplicate anything in the pom to make it work. |
Awesome, I looked at the open issues before I actually explored the documents. This looks like exactly what I need. Out of curiosity, why is this issue still open? |
no real reason other then poor house keeping - i think it can be closed. |
Does docker-compose option works in detach mode ? I am not able to use it with detach mode! |
Add support for Fig and the successor Docker compositions via the new external configuration mechanism.
The text was updated successfully, but these errors were encountered: