Jenkins can be deployed on Docker container in 3 simple steps.
Step 1: Jenkins docker-compose blueprint.
This blueprint is very straight-forward. Here we are going to deploy the "latest" version of Jenkin image. And expose port 8080 to VM/Host port 8080.
You can find the blueprint on HyperForm.
https://www.dchq.io/#/library/2c9180865644050001564c6431fd629d
Step 2: Environment to deploy.
All you need to deploy the blueprint is a host or a VM with docker installed.
Step 3: Deploy and Manage.
Jenkins is now deployed and I can access the admin page by clicking the 8080 port no.
Optional: Configure and Secure Jenkins
If you go to Jenkins page, this is what it looks like.
It says you to copy the text from this location "/var/jenkins_home/secrets/initialAdminPassword" from Jenkins container.
Luckily HyperForm provides an in-browser terminal for containers. This means I don't have to log in to the host on which my Jenkins is running and neither I need to get inside the container to copy the text, simply I can use the in-browser terminal and run "cat /var/jenkins_home/secrets/initialAdminPassword" to print the secret. I can copy page the value and continue installation.
What if you want to use the host's machine docker inside of Jenkins? Does not seem to work via mounting -v //var/run/docker.sock:/var/run/docker.sock
ReplyDelete