Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.18 KB

1.agent.md

File metadata and controls

28 lines (20 loc) · 1.18 KB

Jenkins 代理

使用 SSH 密钥对

ssh-keygen
cat ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub

Manage Jenkins --> Manage Credentials --> Add Credentials

创建 Docker 容器代理

docker run -d --rm --name=agent1 -p 22:22 --network jenkins ^
-e JENKINS_AGENT_SSH_PUBKEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCU6ybkUStrNMLiP7fO/XsqGU5V6yTTJGh+cGeZhv5/wlVJZRW/M/6TiJ0x8QYw4Ef13VwkYRFlySC3MxSXqzsTZOUA3FNp0gN6B+CileMCpEARsRfuGW7gDo80/be+UhcKXw5HoCXrgc0RP1qiTugg6G9qAT4SLC+LZsyFjOjwa2Jcss01BN5e8lcoNs+Das7uAMtcEWft/snSK7yPbtYPpmPcfXcROYS7RkcPR0l4d/gznrtEdmG4twMbaWvvLliusiCr4zzq0F/QVq98GL03k+QNnIrGi5OiXqgsQLwetsY5nH7vx+DdxFkhxezYQQ8aFZACvbiROUxEVB676O5ukJKblALi3WCAEf5FRBimgHffRRJZloct+VleVb770osarAbALeBbNUkLR98+sy7XUUW5XheJiIfhDoAiz8371i6olKI2M9IfpdJ9gFk6pYazZ4U8QuH2TVAwFAs+ffC7esuEexCj1prUqG49vuIx5hNeCJzCtL0gtGZf0RaT3LE= jenkins@035efc752303" ^
jenkins/ssh-agent:alpine-jdk17

设置 jenkins 代理

Manage Jenkins --> Manage Nodes and clouds --> New Node