Support running Docker containers
There are times when using Docker as part of a build environment involves running images after they are built (for example to build an artifact that has a specialized environment). In this case it would be handy to be able to run containers as part of the build process.
FYI -- I'm currently working on this since it is something we need in our build environment.
Creating containers from images, then running, pausing and stopping them would be a nice feature. I think it would be best to implement this as seperate tasks (DockerRun, DockerStop, ...) so that the existing Docker task type not gets too crowded. What do you think?
It might be worthwhile to check out @bmuschko (https://github.com/bmuschko/gradle-docker-plugin) docker plugin. Maybe something we can build on.
Agreed. I've got a DockerRun task type essentially implemented at this point. Doesn't support every run option (there are lots and I'm not sure they are all valuable in this context), but I have support for: --name, -d, --rm, --link, --volume, --publish, and --volumes-from.
Hadn't thought of adding a DockerStop, but that makes sense as well.
Interesting, I'll take a look and see what we might be able to use.
Oh, I also have support for --env as well. One downside right now is that I need docker-java 0.9.1-SNAPTSHOT since it has a bunch of the run options that I use. I'm going to poke the dev list and see if/when they can get that released. Hopefully ownership hasn't lapsed again.
FYI -- the docker-java guy is back from vacation and expects to have the 0.9.1 release out this week.
Great news! Thanks for the information..
Is there any chance of getting a new release soon that includes this feature?