Jenkins with Docker

jenkins
blueocean
JClouds Plugin

Jenkins

  1. 重启,关闭,重载
    http://localhost:8080/exit
    http://localhost:8080/restart
    http://localhost:8080/reload

Jenkins & Docker

CloudBees Custom Builds Environment Plugin

CloudBees Custom Builds Environment Plugin allows Docker images and files to serve as template for Jenkins agents, reducing the administrative overhead of an agent installation to only updating a few lines in a handful of environment definitions for potentially thousands of agents.

Jenkins Pipeline Docker plugin

The Jenkins Pipeline Docker plugin extends these pipelines even further to provide first class support for Docker images and containers. This plugin allows Jenkins to build/release Docker images and leverage Docker containers for customized and reproducible agent environments.
Orchestrating Pipelines with Jenkins and Docker with the CloudBees Pipeline Docker Plugin
docker-workflow-plugin
Docker Pipeline Plugin

Pipeline Utility Steps

提供了很多方便的函数可以在编写jenkinsfile文件的时候使用;
Pipeline Utility Steps
注意,安装完此插件之后需要重启,否则会出现如下的问题Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject;大部分插件安装完之后,都需要重启一下才好使,不然各种问题;

Cloudbees Docker Traceability

you can track all projects using an image, or configure this project to be triggered automatically when an updated image is pushed to the Docker registry. If you use Cloudbees Docker Traceability

FAQ

问题1
找不到/var/run/docker.sock文件
解决方案:
docker容器内的jenkins在容器内肯定找不到/var/run/docker.sock文件
启动的时候挂在上:

docker run -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean

问题2

+ docker pull maven:3.5.2-jdk-8
Warning: failed to get default registry endpoint from daemon (Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.33/info: dial unix /var/run/docker.sock: connect: permission denied). Using system default: https://index.docker.io/v1/
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.33/images/create?fromImage=maven&tag=3.5.2-jdk-8: dial unix /var/run/docker.sock: connect: permission denied
script returned exit code 1

解决方案:

docker run -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock --group-add=$(stat -c %g /var/run/docker.sock) jenkinsci/blueocean

参考

Jenkins的关闭、重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陈振阳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值