👀To start with Jenkins continuous integration and delivery server we would be running simple Jenkins as a container and just play around with it.
Note:- We would be directly looking into Jenkins image as we had cover previous article with docker installation if you want you can refer the link
Simple running containers like Jenkins
Docker Pull command for Jenkins
docker pull jenkins/jenkins
And it should go out pull the Jenkins images and layers and run an instance of Jenkins.
If faced issue during running image and found below message then it might be due to previous unsuccessful runner setup.
Map a port to 8080 on docker host
docker run -p 8080:8080 jenkins/jenkins
Now in order to persist that data across docker container or across docker container restarts or even if you destroy docker container and run a new container and if you'd like to persist your configuration You need data to get to map volume
Create a local directory
pwd
/root
mkdir jenkins-jenkins
This will store the Jenkins data in /your/home
on the host. Ensure that /your/home
is accessible by the Jenkins user in container (jenkins user - uid 1000) or use -u some_other_user
parameter with docker run
.
You can also use a volume container:
docker run -p 8080:8080 -v /root/jenkins-jenkins:/var/jenkins_home -u root jenkins
Next, as you can see it's extracted and Jenkins is actually running and it just pull down Jenkins latest version of Jenkins and ran it
This is the user Interface of Jenkins you will ask for the Admin password for setup Please copy the password from location /var/jenkins_home/secrets/initialAdminPassword
Customize Jenkins select Install suggested plugins
It will start with Getting Started
Create First Admin User
Jenkins is ready
Create a first Test Job
If you liked what you read, do follow and Any feedback for further improvement will be highly appreciated!
Thank you and Happy Learning!👏