Dry goods | build a continuous integration platform on docker Jenkins

Time:2022-7-24

Jenkins is an open source ci&cd software leader, providing continuous integration and continuous delivery services. There are more than 1000 plug-ins to support construction, deployment and automation to meet the needs of any project.

You can visit the introduction website of Jenkins image:Docker Hub 1See more information.

docker pull jenkins/jenkins
docker run -d --name=myjenkins -p 8080:8080 jenkins/jenkins

For the Jenkins container started in this way, the data will disappear after the Jenkins container is deleted. If you need to save Jenkins’ data, please check the following way to start the Jenkins container.

  1. Create a new Jenkins directory and modify permissions create a new directory
mkdir jenkins

change permission

chmod 777 jenkins

• 777 is read-write execution on behalf of all users and groups.

  1. Start Jenkins and add the -v parameter to the mount directory
docker run --name jenkins -d -p 8080:8080 -p 50000:50000 -v 
${PWD}/jenkins:/var/jenkins_home jenkins/jenkins

• -p 8080:8080:8080 port is the web access port of Jenkins service -p 50000:50000 port is the port used by Jenkins to communicate with other Jenkins nodes

• -v ${PWD}/jenkins:/var/jenkins_ Home: mount the host ${pwd}/jenkins directory into the container /var/jenkins_ Home directory, where ${pwd} is a system variable, representing the current directory.

  1. In browser access:Http:// your IP address: 8080, enter the Jenkins configuration page

  2. Use docker exec -it Jenkins cat /var/jenkins_ The home/secrets/initialadminpassword command gets the default password. Where Jenkins is the name of the container. The cat command can view the text content, /var/jenkins_ Home/secrets/initialadminpassword is the path where the default password is stored.

Enter the password obtained in the previous step to enter the Jenkins service.

So far, all operations have been completed. Please use Jenkins service happily.

 

Friends who like software testing, if my blog is helpful to you, and if you like the content of my blog, please “like”, “comment” and “collect” one click three times.More technical articles

Recommended Today

RabbitMQ study notes

Table of contents Related concepts RabbitMQ Install RabbitMQ core part Hello World Work Queues release confirmation switch fanout exchange (pub/sub) direct exchange topic exchange dead letter queue delay queue Release Confirmation Advanced The switch receives the message confirmation callback Fallback message to producer when switch is not routable Backup switch other idempotency priority queue lazy […]