zoukankan      html  css  js  c++  java
  • Jenkins与Docker相关的Plugin使用

    原文地址:http://blog.csdn.net/ztsinghua/article/details/52128140

    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并测试连接。

    docker-build-step

    在Jenkins JOB的构建区域,增加构建步骤→Execute Docker container

    有一系列Docker Command可选择

    docker-build-step

    docker-build-step

    以重启一个容器为例

    选择Restart containers命令,并填写Container ID(s):

    docker-build-step

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

    docker-build-step

    以Push镜像到Docker registry为例

    选择Push images命令,并填写相关信息:

    docker-build-step

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

    docker-build-step

    Docker Build Publish Plugin使用

    设置源码地址,这里使用的是GIT@OSC

    该项目是个Docker化的项目,Dockerfile在根目录下

    docker-build-publish

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

    docker-build-publish

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

    docker-build-publish

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

    docker-build-publish

    参考

  • 相关阅读:
    Java如何实现跨平台?
    Javascript的对象再认识
    说说javacsript的函数
    setTimeout() 与setInterval()
    datepicker 插件
    table中,表头固定,body滚动的方式。也就是使用:css Table布局-display:table
    jgrid的相关知识
    学习笔记
    ES6 — 箭头函数
    受控组件
  • 原文地址:https://www.cnblogs.com/boonya/p/7387787.html
Copyright © 2011-2022 走看看