Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker_ Rapid deployment jenkins (dockerfile implementation)

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I am using the base image of ubuntu14.04, and I have configured the installation package of ant,tomcat,jdk in the base image. I will not repeat the details here.

Create a Dockerfile file in the / tmp/ directory:

Touch Dockerfile

Vi Dockerfile

Here is the Dockerfile file I wrote

Which image is the first line of FROM based on

The second line is the contact information.

RUN is a command that runs inside Dockerfile

ENV is used to configure environment variables

CMD is the command that is executed after the build, where tomcat is started

EXPOSE 8080 this is the port required by tomcat

Save these after writing, and then execute the following command to build

Docker build-t {name}: {tag}. Where-t names the image, tag is the tag, followed by a. Which means to find Dockerfile from the current directory

In the figure above, you can see that dockerfile is following the command steps. Let's run docker images again to see the built image.

Now let's activate this mirror image.

Docker run-d-- name jenkins-p 80 home/jenkins_home1:/home/jenkins_home1 jenkins:u3 8080-v / home/jenkins_home1:/home/jenkins_home1 jenkins:u3-p is to map ports from 8080 to 80

Check the health status and find that the jenkins service is up and running on port 80.

Page launches jenkins

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report