shamnad sherief
shamnad sherief's Blog

Follow

shamnad sherief's Blog

Follow
Running Jenkins On Docker

Running Jenkins On Docker

shamnad sherief's photo
shamnad sherief
·Jan 31, 2023·

1 min read

Play this article

In the previous article, we saw how to install and run Jenkins on your Linux machine. In this one, we are running Jenkins on a docker container.

First of all, you need to update the source and install docker.

sudo apt-get update && sudo apt-get install docker.io

Run the container

sudo docker run -it -d -p 8080:8080 -p 50000:50000 --name=jenkins -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts-jdk11

That's all. Now you have Jenkins running on your docker container.

Your Jenkins should be running on port number 8080 and you can access it by opening a browser and entering localhost:8080 or click here

For the password, run:-

sudo docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
 
Share this