前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >Jenkins与Docker相关的Plugin使用

Jenkins与Docker相关的Plugin使用

作者头像
donghui
发布2019-04-19 15:16:19
发布2019-04-19 15:16:19
4.5K0
举报
文章被收录于专栏:donghui的博客donghui的博客

##Jenkins与Docker相关的Plugin使用## ###Jenkins与Docker相关的Plugin### 在Jenkins Plugin页面搜索与Docker相关的插件,有如下几个:

  • CloudBees Docker Build and Publish plugin — This plugin provides the ability to build projects with a Dockerfile, and publish the resultant tagged image (repo) to the docker registry.
  • Docker build step plugin — This plugin allows to add various Docker commands into you job as a build step.
  • Docker Plugin — This plugin allows slaves to be dynamically provisioned using Docker.
  • Kubernetes Plugin — This plugin allows slaves to be dynamically provisioned on multiple Docker hosts using Kubernetes.
  • Docker Commons Plugin — APIs for using Docker from other plugins.

其中,它们间的关系如下:

  • Docker commons Plugin为其他与Docker相关的插件提供了APIs
  • CloudBees Docker Build and Publish plugin和Docker build step plugin都依赖了Docker commons Plugin
  • Kubernetes Plugin依赖了Docker Plugin

下面主要介绍下Docker build step plugin和CloudBees Docker Build and Publish plugin的使用。

###Docker build step plugin使用###

####设置Docker URL#### 系统管理→系统设置→Docker Builder,设置Docker URL并测试连接。

####在Jenkins JOB的构建区域,增加构建步骤→Execute Docker container#### 有一系列Docker Command可选择

####以重启一个容器为例#### 选择Restart containers命令,并填写Container ID(s):

Jenkins JOB创建成功后,点击构建,日志输出如下:

####以Push镜像到Docker registry为例#### 选择Push images命令,并填写相关信息:

Jenkins JOB创建成功后,点击构建,日志输出如下:

###Docker Build Publish Plugin使用###

####设置源码地址,这里使用的是GIT@OSC#### 该项目是个Docker化的项目,Dockerfile在根目录下

####在Jenkins JOB的构建区域,增加构建步骤→Docker Build and Publish####

此外,Docker Build Publish Plugin还要一些高级选项

####Jenkins JOB创建成功后,点击构建,日志输出如下####

###参考###

(adsbygoogle = window.adsbygoogle || []).push({});

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015/07/21 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档