How To Setup Jenkins in Docker
My next few blogs will be related to Jenkins, Docker and Kubernetes .
FYI, Same tutorial is available in youtube.
What’s Jenkins? Jenkins is a automation tool which you can create jobs to build, test and deploy your application.
You can create your pipelines in Jenkins. But whats’s pipeline? Pipeline is a script which executes step by step of all things you need to do. Example: you will create a pipeline to build your code. First step is to checkout your git code, after this you need to test, build, package, create a docker image and finally, deploy your code.
For first step with Jenkins, let’s create a container in your machine.
You need Docker installed and running in your machine.
Execute this command:
docker run -p 8080:8080 -p 50000:50000 jenkins
This command will download and run a Jenkins in your machine.
Wait for some time,when Jenkins was initialized, the console will show you a admin password to start Jenkins initial setup. The text with password is:
*************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:b9ad7c6d6b894ba89d7b8d******
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
**************************************
You can access your Jenkins in http://localhost:8080/. You will see this screen and provide the initialAdminPassword to continue:
In next screen, click “Install suggested plugins”
Wait for the plugins installations
Now, create a first admin user by providing the username and password.
We finished the installation, click “Start using Jenkins”
Cheers! My next blog will be on Sending email notification on Jenkins post build, check out :)