When using pod templates and Jenkins pipelines you could use lots of different containers for each tool. e.g. one container for maven and another for git etc.
We’ve found its much simpler to just have a single builder container with all the common tools inside. This also means you can use kubectl exec or jx rsh to open a shell inside the build pod and have all the tools you need available for use when debugging/diagnosing problem pipelines.
So the simplest thing could be to copy a similar builder - like builder-maven and then edit the Dockerfile to add whatever build tools you need.
We love Pull Requests and contributions so please submit Pull Requests for new build containers and Pod Templates and we’re more than happy to help!
Adding your own Pod Templates
To keep things DRY and simple we tend to define pod templates in the Jenkins configuration then refer to the by name in the Jenkinsfile.
There are attempts to make it easy to inline pod template definitions inside your Jenkinsfile if you need it; though a pod template tends to have lots of developer environment specific stuff inside it, like secrets, so we’d prefer to keep most of the pod templates inside the source code of your development environment rather than copy/pasting them into each app.
Today the easiest way to add new Pod Templates is via the Jenkins console. e.g.
That will open the Jenkins console. Then navigate to Manage Jenkins (on the left hand menu) then Configure System.
You will now be faced with a large page of configuration options ;) The pod templates are usually towards the bottom; you should see all the current pod templates for things like maven, nodejs etc.
You can edit/add/remove pod templates in that page and hit Save.
So longer term we’re hoping to add the Pod Templates into your values.yaml file in your developer environment git repository like we do for the jenkins-x-platform chart.
If you are creating pod templates using open source build tools then it may be simpler for you to just submit your pod template in a Pull Request and we can bake that pod template into future releases of Jenkins X?