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: