How To Setup Jenkins in Docker

Pradeep Gopalgowda
2 min readSep 18, 2018

--

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.

Jenkins + Docker

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:

Unlock Jenkins

In next screen, click “Install suggested plugins”

Customize Jenkins

Wait for the plugins installations

Getting Started

Now, create a first admin user by providing the username and password.

Create First Admin User

We finished the installation, click “Start using Jenkins”

Jenkins is ready

Cheers! My next blog will be on Sending email notification on Jenkins post build, check out :)

--

--

No responses yet