Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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 :

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.

running Jenkins container

Now goto http://localhost:8080

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:

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 :

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

Docker Tutorials: Docker Image – Understanding Dockerfiles instructions & options

Here’s a step-by-step tutorial for Dockerfile, including explanations and examples for each major command. Dockerfile Tutorial A Dockerfile is a text file containing instructions to build a…

Read More

Docker Tutorials: Docker Image – Example and Sample Programs of Dockerfile

Reference Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories…

Read More

Docker Tutorials: Installation and Configurations

Docker Installation in Centos/RHEL Method -1: How to install Docker Community Edition via YUM? Step 1 – Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data…

Read More

Docker Tutorials: How to Install Docker in Ubuntu?

Install Docker Engine in Ubuntu NOTE – All commands you must run as root user or add a current user into a linux group name called “docker”…

Read More

Docker Lab, Excercise & Assignment – 7 – Docker Volume

Below is a very detailed tutorial and lab manual for learning Docker Volumes, using the Ubuntu image for practical, hands-on labs. This covers all major types of…

Read More

Docker Lab, Excercise & Assignment – 4 – Docker Networking

Here’s an in-depth, step-by-step tutorial and lab manual for Docker Networking—starting from basics, covering all core concepts, and providing a hands-on guide to every feature and command….

Read More