This is an example of running Docker builds on CloudBees Core on Kubernetes using agent pod configuration through the Jenkins configuration UI. This example runs a maven build, docker build and pushes the image to docker hub. For an example of how to use agent pod templates see this repo.
- CloudBees Core 1.212.2.1 with Kubernetes Plugin 1.7.1
- In CJOC, go to the top level Jenkins navigation and select the All tab.
- Select kubernetes shared cloud.
-
Select Configure.
-
Here you will add a Kubernetes Pod Template and add the containers you need. The Pod Templates are available to all masters. For this project, these values were specified:
-
Then see the Jenkinsfile for an example pipeline of how these containers are used to do the maven build, docker build and push to the registry.
-
In this example, DockerHub is used. Add your credentials for DockerHub so that they can be referenced by the pipeline.