Use of Docker-related Jenkins plug-ins

Source: Internet
Author: User
Tags cloudbees docker registry

Use of Docker-related Jenkins plug-ins
Jenkins plug-ins related to Docker use Jenkins plug-ins related to Docker

Search for Docker-related plug-ins on the Jenkins Plugin page, which include the following:

  • 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 varous 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.

The relationships between them are as follows:

  • Docker commons Plugin provides APIs for other Docker-related plug-ins
  • Both CloudBees Docker Build and Publish plugin and Docker build step plugin depend on Docker commons Plugin.
  • Kubernetes Plugin depends on Docker Plugin

The following describes how to use Docker build step plugin and CloudBees Docker Build and Publish plugin.

Docker build step plugin use to set the Docker URL

System Management → system settings → Docker Builder, set the Docker URL and test the connection.

In the build area of the Jenkins JOB, add the build step → Execute Docker container

There are a series of Docker commands available

Take restarting a container as an Example

Select the Restart containers command and enter the Container ID (s ):

After the Jenkins JOB is created successfully, click build. The log output is as follows:

Take the image Push to Docker registry as an example.

Select the Push images command and enter the relevant information:

After the Jenkins JOB is created successfully, click build. The log output is as follows:

Docker Build Publish Plugin sets the Source Code address. Here GIT @ OSC is used.

This project is a Docker project, and the Dockerfile is under the root directory.

In the Build area of the Jenkins JOB, add the Build step → Docker Build and Publish

In addition, Docker Build Publish Plugin requires some advanced options

After the Jenkins JOB is created successfully, click build. The log output is as follows:

Reference
  • Docker + build + step + plugin
  • Docker + Build + and + Publish + plugin

Distributed building and deployment of Jenkins-nodes

Jenkins details: click here
Jenkins: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.