MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Jenkins Tutorials: Install Jenkins as Docker Container

In the Previous Post we Learned How to install Jenkins as Servlet on Tomcat server.

In this post we will try even simple and easy way to run Jenkins on your machine using docker.

Like all major servers Jenkins also comes as a light weight container and is being maintained by community aggressively.

Pre-requisites :
1. Basic docker understanding.
2. Docker should be up and running on the host machine.
If you feel you need refresher for any of the above – try searching it on devopsschool.com – we have plenty of content available 🙂

Let’s start, first check docker daemon is running on the machine where you want to install Jenkins as container.

For me, I’m going to do it on my mac machine locally – steps would be pretty much similar if we want to do it on cloud machine as well.

Run,

docker version

It should some like below on screen :

Terminal output of docker version showing Docker Engine Community 19.03.5 client and server details
docker version

Run docker command :

docker run -p 8080:8080 -d jenkinsCode language: CSS (css)

Let me explain what we did above , we are asking docker to run Jenkins container on port 8080 for the localhost host machine which will be routing traffic to port 8080 to the Jenkins container and -d tag tells to run this container in detached mode.

If we don’t have the Jenkins container image locally, docker will go and download it from the docker hub registry. You will see something like this below as out put.

Terminal running docker run -p 8080:8080 -d jenkins pulling the image, then docker ps showing the container up
running Jenkins container

Now goto http://localhost:8080

Unlock Jenkins page at localhost:8080 asking for the administrator password from initialAdminPassword
Jenkins home page

Now a big question how to find out admin password ??? as the password would be in container and not in local host machine, we should get it from there.

Run below command :

docker exec <containerID> cat /var/jenkins_home/secrets/initialAdminPasswordCode language: HTML, XML (xml)

This will print out the admin password on screen, something like this:

Terminal with docker exec cat /var/jenkins_home/secrets/initialAdminPassword printing the Jenkins admin password

Note, as container ID gets generated on the run time. It would be different for you and me.

Lets copy this password and enter it on the jenkins dashboard :

Customize Jenkins setup screen offering Install suggested plugins or Select plugins to install

If you are seeing dashboard like above – congratulations you have successfully installed Jenkins as docker container pat your back and start using it.

More on Jenkins in the upcoming lectures. If you like this article feel free to check other articles by me.

Gaurav Bajpai

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in offers unparalleled convenience and affordability in bike rentals, allowing users to enjoy hassle-free rides for commuting, exploring, or leisure trips. With a wide range of bikes and scooters, it’s your trusted partner for all two-wheeler needs.

Related Posts

Install Sonatype Nexus with Docker: RM2/RM3 Commands, Validation Steps, and Important Caveats

A structured, production-minded rewrite of the original 2016 Docker setup for Sonatype Nexus Repository Manager 2 and 3. Includes command examples, a workflow diagram, and clear warnings about outdated tags/endpoints.

Read More

Docker Lab & Assignment – Creating an Image

Here’s a detailed Tutorial and Lab Guide for the listed Docker commands, focused on practical usage, explanations, and step-by-step labs with Ubuntu + git + apache2 as…

Read More

Docker commands Guide – docker tag with examples

Here’s a complete tutorial on docker tag, covering what it does, examples, and use cases. What is docker tag? docker tag is a Docker command that creates…

Read More

Docker commands Guide – docker save with examples

Here’s a complete tutorial on docker save and docker load, covering what they do, examples, and use cases. What are docker save and docker load? Key Features:…

Read More

Docker commands Guide – docker rmi with examples

Here’s a complete tutorial on docker rmi, including what it does, examples, and use cases. What is docker rmi? docker rmi is a Docker command used to…

Read More

Docker commands Guide – docker load with examples

Here’s a complete tutorial on docker load, covering what it does, examples, and use cases. What is docker load? docker load is a Docker command used to…

Read More