Use Docker to create and run Jenkins detailed steps

1. Use Docker to build Jenkins

Blog address: https://blog.csdn.net/YZL40514131/article/details/130044163

2. Configure the execution node for Jenkins

1. Enter the management page

insert image description here

2. Create a new node

insert image description here
insert image description here

3. Configure node information

insert image description here
insert image description here

4. The child node connects to the master node

The node is not online

insert image description here

insert image description here

5. Run the command copied above on the child node machine

The child node needs to have a java 11 environment.
The child node has the curl command.
The child node can communicate with the master network (can ping each other).
The child node can access the 50000 port of the master (can be tested by telnet master-ip 50000)

echo f4f697ceb0359d2b6eab5419b9e38cdc6c3a2a0a3bc403cc294eab952815cd42 > secret-file
curl -sO http://192.168.22.3:8080/jnlpJars/agent.jar
java -jar agent.jar -jnlpUrl http://192.168.22.3:8080/manage/computer/docker%20%5Fnode1/jenkins-agent.jnlp -secret @secret-file -workDir "/root/jenkins_list"

insert image description here

6. Check whether the child node is online

insert image description here

3. Create a simple job

1. Enter the creation page

insert image description here

2. Set the job name

insert image description here

3. Configure job related information

insert image description here
insert image description here

4. Build a job

insert image description here

5. View the console output

insert image description here

Guess you like

Origin blog.csdn.net/YZL40514131/article/details/130142810