We implemented a similar Use Case: 

   - Create an isolate environment for each team
   - Whenever they have commit/PR triggers a build and create a container 
   to build that project.
   - If the Dockerfile in that project has changed, refresh the docker 
   image then create container based on the new image.

The solution is (refer and tailor on your case):

   - Use multibranch project so Jenkins will trigger with git commit/PR
   - Put Dockerfile into the project folder (let the team maintains their 
   environment), use the Jenkins ChangeSet to verify if the Dockerfile has 
   changed so you will refresh (remove the existing image then build a new one 
   with the updated Dockerfile) the docker image on your Jenkins executor
   - Build the docker image/container as a Jenkins slave (use swarm-client, 
   accept the security issue with this plugin)
   - Run the build/test the project on your new slave container (consider 
   about concurrent pipeline with the new container)
   - If the build is green, back to the slave/host then push/update the 
   image into the docker registry

Hope this can help

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5ca8978f-78ed-468a-8050-f7193df7f5c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to