Redeploying Jenkins using JCasC
We'll redeploy Jenkins using the new Dockerfile with plugins preinstalled and the JCasC configuration file:
- SSH into the controller host.
- Build a custom Docker image for the controller with plugins preinstalled and name it
<Docker Hub ID>/jenkins:2.263.
1-plugins
:controller:~$ docker build -t calvinpark/jenkins:2.263.1-plugins
-f jenkins.dockerfile .During the image build, we can see that the plugins are installed.
- Create a new directory named
jcasc_home
, then copyjcasc.yaml
into thejcasc_home
directory:controller:~$ mkdir jcasc_home
controller:~$ cp jcasc.yaml jcasc_home/
- Stop and delete the existing Jenkins controller to release the ports (don't worry, we'll get it back):
controller:~$ docker stop jenkins_controller
controller:~$ docker rm jenkins_controller
- Finally, run the new Jenkins...