Jenkins与Docker相关的Plugin使用
2016-08-05 13:17
681 查看
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创建成功后,点击构建,日志输出如下
参考
Docker+build+step+pluginDocker+Build+and+Publish+plugin
相关文章推荐
- 《docker入门实战》读书笔记1——写在前面的话
- Centos下二进制方式安装MySQL (Docker-Centos镜像环境)
- tomcat利用setenv对内存的限制和docker中tomcat内存的优雅配置
- Docker Universal Control Plane(UCP)——提供企业级的容器云的解决方案
- docker容器资源配额控制
- docker1.12版本的swarm集群特性 推荐
- Docker启动失败的处理
- 数人云CTO解读Docker 1.12和金融业容器化
- 数人云CTO解读Docker 1.12和金融业容器化
- 使用harbor配置私仓
- centos7 安装 卸载docker
- 免 sudo 使用 docker
- 基于Mesos、Docker、Marathon实现的可伸缩微服务思路
- 使用 docker 搭建私有 pypi
- Kubernetes 1.3.4版本之kubelet改动
- Kubernetes 1.3版本之简单安装
- 用Docker构建LNMP环境(上)
- docker的一些命令
- 从零开始使用Jenkins来构建Docker容器(Ubuntu 14.04)
- Docker私有仓库Registry的搭建验证