How to create customize jenkins image in docker?

0 votes

Hi Guys,

I want to create one cluster of Jenkins. So I am trying to implement this task on Docker. Can anyone help me, how can I create Jenkins image?

May 18 in Docker by akhtar
• 25,210 points
103 views

1 answer to this question.

0 votes

Hi@akhtar,

You can pull Jenkins image from docker hub. But if you want to create a customize image of Jenkins, you can use Dockerfile. Here I have attached one Dockerfile for your reference.

FROM centos:7
RUN  yum install wget -y
RUN yum install java-11-openjdk.x86_64 -y
RUN wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
RUN rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
RUN yum install jenkins -y
RUN yum install /usr/sbin/service -y
EXPOSE 8080
RUN yum install sudo -y
RUN echo "jenkins ALL=(ALL) NOPASWD: ALL" >> /etc/sudoers
RUN yum install iptables -y
ENTRYPOINT service jenkins restart && bash


Hope this will help.

answered May 18 by MD
• 56,940 points

Related Questions In Docker

0 votes
1 answer

How to store data in external drive with Docker Postgres:9.3 image?

Apparently, the problem would be in your ...READ MORE

answered Jul 12, 2018 in Docker by Kalgi
• 2,620 points
703 views
0 votes
1 answer
0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 22, 2019 in Docker by Kalgi
• 51,950 points
316 views
0 votes
1 answer

how do I create an image from a tar archive in docker?

You can use docker load command inorder to get ...READ MORE

answered Jul 2, 2019 in Docker by Sirajul
• 57,940 points
659 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,640 points
778 views
0 votes
1 answer

How to create our own docker image?

Hi@akhtar, There are two ways to create docker ...READ MORE

answered Mar 11 in Docker by MD
• 56,940 points
100 views
0 votes
1 answer

How to create a secret in docker?

Hi@akhtar, In Docker, a secret is any blob ...READ MORE

answered Aug 17 in Docker by MD
• 56,940 points
59 views