0

I have setup a build pipeline in jenkins using the build pipeline plugin. The second step of the pipeline is to deploy to a dev environment. As I have micro services, I want to deploy each micro service in a docker container.

I have manually configured the container already to run these microservices but now I want to automate the process and each successful checkin should update the code in the container and restart it.

I tried to use the docker plugin for jenkins and it has an option "Commit container change" which I was hoping will do exactly the same but I cant get this work.

https://wiki.jenkins-ci.org/display/JENKINS/Docker+build+step+plugin

Any ideas on how to setup this up.

Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
  • I'm assuming you're able to build the container on each commit and possibly you're additionally pushing it to a registry. What you need is a follow-on job triggered by the build, that deploys or redeploys the container. How this works depends on where you're running the container (locally or on a remote machine) – Mark O'Connor Apr 25 '15 at 04:46
  • I don't have a private docker registry. I don't want the whole process of image creation, uploading it to a registry and then spinning off a container from that newly created image. I just want to be able to update the code running in a currently running container. Docker host is a remote machine and Jenkins is running in a separate vm. – Chirdeep Tomar Apr 25 '15 at 14:47
  • In that case perhaps you should consider compiling and running the code within a container? See: http://stackoverflow.com/questions/27767264/how-to-dockerize-maven-project-and-how-many-ways-to-accomplish-it/27768965#27768965 – Mark O'Connor Apr 25 '15 at 22:31

0 Answers0