How To Install Jenkins With Docker Image – DecodingDevOps

How To Install Jenkins With Docker Image - DecodingDevOps

using docker we can easily install any tool on the servers. docker is containerization tool, using the docker images we will create containers. Once we created the containers we can access the tools or applications. in this article i will explain how to install Jenkins with docker image or how to create jenkins docker container.

before installing Jenkins in the server, make sure that docker is installed on your server. if you have not installed, you can install with below articles.

by following above articles you can easily install the docker on your server. once you install the docker on the server you can go head with installation of Jenkins with docker image.

Install Jenkins With Docker Image

docker run -itd -p 8081:8080 jenkins/jenkins:lts



Unable to find image 'jenkins/jenkins:lts' locally
lts: Pulling from jenkins/jenkins
3192219afd04: Pull complete
17c160265e75: Pull complete
cc4fe40d0e61: Pull complete
9d647f502a07: Pull complete
d108b8c498aa: Pull complete
1bfe918b8aa5: Pull complete
dafa1a7c0751: Pull complete
8debb2a797ac: Pull complete
b61ee195341b: Pull complete
077a9a7f734d: Pull complete
d98b8fe6b0e0: Pull complete
984b62d17d53: Pull complete
c340331b32a0: Pull complete
4141f86cd682: Pull complete
7a9a3161243a: Pull complete
b82163a85446: Pull complete
2dc7838ff547: Pull complete
783e9f7bc46e: Pull complete
19c6f26bfeba: Pull complete
Digest: sha256:83df661d1a2ad921323868ca48f432b175b039bb9e16be0209c0253f3186f25e
Status: Downloaded newer image for jenkins/jenkins:lts
c83db9d1c65008d94f8af128184da6c35eaa80574dae4bca9c1f365635d9758f

to create docker container from docker image we use docker run -itd command

Verify The Docker Container

root@ip-172-31-37-35:~# docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                               NAMES
804aac9d96f9        jenkins/jenkins:lts   "/sbin/tini -- /usr/…"   7 minutes ago       Up 7 minutes        50000/tcp, 0.0.0.0:8081->8080/tcp   xenodochial_kepler

using docker ps command we can verify, is the Jenkins docker container running or not. you can see the created and status both are from 7 minutes.

Access Jenkins in the Browser

in the docker Jenkins container Jenkins will run on 8080 port, so we have to map Jenkins docker container port with host server port, in the above command we mapped host server port 8081 with Jenkins docker container port 8080, so we can access jenkins on host server 8081 port.

To access jenkins in the browser enter publicip:8081

  • install jenkins with docker image
  • jenkins with docker image
  • jenkins container create
  • create jenkins docker container

Leave a Reply

Your email address will not be published. Required fields are marked *