arun-gupta / microservices

Java EE and Microservices
629 stars 381 forks source link

Refactored to work with docker-maven-plugin #42

Closed rhuss closed 9 years ago

rhuss commented 9 years ago

The docker plugin configuration has been moved to the subprojects and the configuration adapted accordingly.

If no linking is required between Docker containers, the prefered way to configure this plugin is within submodules. Currently there is quite some redundancy, this is currently unavoidable. Latter on the dmp might be enhanced to allow for some templating in the configuration.

Some remarks about the base image jboss/wildfly:

I had to make some minor fixes for the Docker Maven Plugin, since up to now it was not tested very well in a multi-module-project. So currently 0.12.1-SNAPSHOT is used, but I will make a release at the end of this week for 0.12.1

The configuration of the plugin also has been moved out of the profile, since it doesn't harm anyway. I left the binding to execution phases in the profile, though.

You can now build the images with

mvn package docker:build

(package is required because of a Maven limitation, otherwise the assembly can't find its artefact) and start it with

mvn docker:start

This can be done also in a single subproject. A new, quite cool feature is 'mvn docker:watch' so when you call

mvn clean package docker:build docker:start docker:watch

in one terminal (it will block) and then change and compile any subproject, the Docker image will automatically be rebuilt and restarted. This only works from within a subproject and not top-level because it blocks.