Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Support running Docker containers #19

Open sfitts opened 10 years ago

sfitts commented 10 years ago

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.

sfitts commented 10 years ago

FYI -- I'm currently working on this since it is something we need in our build environment.

mattgruter commented 10 years ago

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?

mattgruter commented 10 years ago

It might be worthwhile to check out @bmuschko (https://github.com/bmuschko/gradle-docker-plugin) docker plugin. Maybe something we can build on.

sfitts commented 10 years ago

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.

sfitts commented 10 years ago

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.

sfitts commented 10 years ago

FYI -- the docker-java guy is back from vacation and expects to have the 0.9.1 release out this week.

mattgruter commented 10 years ago

Great news! Thanks for the information..

davidyscott commented 7 years ago

Is there any chance of getting a new release soon that includes this feature?