CloudBees Docker Build and Publish plugin

2 minute read

Plugin removal from CAP announcement

CloudBees removed this plugin from the CloudBees Assurance Program (CAP) in September 2022. Please contact CloudBees Support if you have any concerns or questions.

The Docker Build and Publish build step is available for Freestyle jobs.

This Jenkins plugin allows to build Docker images on a Docker server and then publish them to Docker Hub or other Docker registries.

Features summary:

  • The entire functionality is implemented as a single build step

  • Support of Dockerfile specifications

  • Publishing to docker index/registry including Docker Hub

  • Credentials support for Docker servers and registries (provided by Docker Commons plugin)

  • On-demand tagging of built images

  • On-demand fingerprinting of built images

  • Image clean build with --no-cache option (rebuild of all steps from Dockerfile steps)

Usage guidelines

Detailed usage guidelines are available on the plugin’s README on GitHub. This article addresses cases related to CloudBees CI and other plugins documented in this section.

The entire functionality is implemented as a single build step.

  • In Advanced options you can disable building and publishing sub-steps using Skip Push and Skip Pull controls.

  • Force pull is enabled by default in order to build images with the latest version of the source image specified in the Dockerfile

  • Image fingerprint creation is enabled by default in order to support value-added features like the Docker Traceability plugin.

Below you can find a sample configuration of the build step:

build step config
Figure 1. Docker Build and Publish build step configuration (with Advanced options)

Limitations

Docker CLI tool location should be set in the environment

CloudBees Docker Build and Publish plugin uses Docker command line tool to interact with Docker servers and registries. Currently there is no integration with Docker ToolInstallation provided by Docker Commons plugin. This plugin expects that docker binary is available in the PATH environment variable on the node where the build is being performed.

Workaround: Define Docker CLI binary in PATH environment variable of each node, which may be used to run builds with Docker Build and Publish steps.