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

What is the concept of docker and jenkins

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the concept of docker and jenkins". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the concept of docker and jenkins".

Docker is an open source application container engine that packages applications and dependencies into a portable image and publishes them to the system's machine, while Jenkins is a powerful application that can handle any type of build or continuous integration.

The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.

What are docker and jenkins?

Docker is an open source application container engine based on the Go language and open source according to the Apache2.0 protocol. Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, no matter what platform is used. This is a free source code that can handle any type of build or continuous integration. Integrated Jenkins can be used for some testing and deployment technologies. Jenkins is a piece of software that allows continuous integration.

Initially, a centos7 is installed on this machine, then docker is installed in the virtual machine, and then the jenkins image is pulled. First of all, for the first pit encountered by beginners, the image pull half-day card will not continue in a certain process (the reason is similar to maven, because the default warehouse is a foreign server is relatively slow) So we can choose some domestic warehouses to pull. I use NetEase. First of all, you need to wait until the address of your image, such as jenkins, is this (under the library directory) / library/jenkins:latest.

Then enter the command line

Docker pull hub.c.163.com/library/jenkins:latest

After the image is finished, you can check all the images.

Docker ps-a

Then we can start to build our Jenkins workbench: (below is the image downloaded by the official warehouse, so the last one is jenkins. If NetEase downloaded it, use their full name, which can be seen in the previous step.)

Sudo docker run-d-- name jenkins_node-p 49002 var/jenkins_node:/var/jenkins_home jenkins:latest 8080-v / var/jenkins_node:/var/jenkins_home jenkins:latest

There are many parameters in this step, let me explain (boss, please skip. (for beginners)-d is to make the jenkins container run in the background, so that you don't have to hang up the command window service.-- name is the name of your container (pick it casually, I almost got killed after my supervisor. )-p this is mapping port 8080 of the container to 49002 so that we access the address 49002 in the actual page, and then there is the parameter-v. This step is easy to step into (at least as a person who is not familiar with linux, I have stepped on a lot of holes). This parameter is to mount the / var/jenkins_node directory on your server (now your virtual machine) to the container's / var/jenkins_home directory. Please note: before running the command line in the above figure, please remember to check whether the current user has read and write rights to the / var folder, otherwise you will find that there is no such file at all when you are asked to enter your initial jenkins login password. How does linux modify file permissions? It is suggested that you should make your own Baidu.

All right, let's move on to the next step: you can skip here if the folder in the previous step has been generated.

In the previous step, the / var/jenkins_node folder was not generated due to permission issues. At this point, we need to pause the service of the container first.

Docker ps-a

Find the id copy of the jenkins container just now and run the following operations to stop and delete the container.

Docker stop (replicated ID)

Docker rm (replicated ID)

And then repeat this step sudo docker run-d-name jenkins_node-p 49002 purl 8080-v / var/jenkins_node:/var/jenkins_home jenkins:lates

Next, when you access http://host:49002 in a browser, the following interface appears

At this time, search the initialAdminPassword file under your / var/jenkins_node folder and copy the initial login password into it. The next step is to ask you to download the default plug-in or customize it (it is recommended that beginners directly choose the first one, which is convenient. What do you need to download in the plug-in management center later?)

After downloading the plug-in, your account password will be set, and this will not be a screenshot. Next, you can go to your workbench to deploy your project.

Thank you for your reading, the above is the content of "what is the concept of docker and jenkins". After the study of this article, I believe you have a deeper understanding of what the concept of docker and jenkins is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Database

Wechat

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

12
Report