-
Notifications
You must be signed in to change notification settings - Fork 644
Motivation
Spring feelings in 2014 seems to be quite fertile for the Java crowd's Docker awareness ;-). Not only I counted 5 maven-docker-plugins on GitHub as of April 2014, tendency increasing. It seems, that all of them have a slightly different focus, but all of them can do the most important tasks: Starting and stopping containers.
So you might wonder, why I started this plugin if there were already quite some out here ?
The reason is quite simple: I didn't knew them when I started and if you look at the commit history you will see that they all started their life roughly at the same time (March 2014).
I expect there will be some settling soon and even some merging of efforts which I would highly appreciate and support.
For what it's worth, here are some of my motivations for this plugin and what I want to achieve:
-
I needed a flexible, dynamic port mapping from container to host ports so that truly isolated build can be achieved. This should work on indirect setups with VMs like boot2docker for running on OS X.
-
It should be possible to pull images on the fly to get self-contained and repeatable builds with the only requirement to have docker installed.
-
The configuration of the plugin should be simple since usually developers don't want to dive into specific Docker details only to start a container. So, only a handful options should be exposed which needs not necessarily map directly to docker config setup.
-
The plugin should play nicely with Cargo so that deployments into containers can be easy.
-
I want as less dependencies as possible for this plugin. So I decided to not use the Java Docker API docker-java which is external to docker and has a different lifecycle than Docker's remote API. (currently v1.8 (docker-java) vs. v1.10 (docker) API version) That is probably the biggest difference to the other docker-maven-plugins since AFAIK they all rely on this API. Since for this plugin I really need only a small subset of the whole API, I think it is ok to do the REST calls directly. That way I only have to deal with Docker peculiarities and not also with docker-java's one. As a side effect this plugin has less transitive dependencies. FYI: There is now yet another Docker Java client library out, which might be used for plugins like this, too: fabric-docker-api. (Just in case somebody wants to write yet another plugin ;-)
For this plugin I still have some ideas to implement (e.g. to bring generated artifacts into the container's FS, even when using VMs like for boot2docker), but otherwise this is not my main project (it is the result of an internal research project here at ConSol*). So I would be happy to contribute to other projects, too, when the dust has been settled a bit.
In the meantime, enjoy this plugin, and please use the issue tracker for anything what hurts.