The YAML schema for DockerPush native step is as follows:
An alphanumeric string (underscores are permitted) that identifies the step.
DockerPush for this step type.
Description of usage
|Must specify an affinity group string that is the same as specified in a prior DockerBuild step.||Optional|
|Must specify an Artifactory Integration.||Required|
| ||Typically the DockerBuild step that built the image. The DockerBuild step must always be in the same affinity group, but other steps, such as Bash or PowerShell, are also permitted in the same affinity group, between DockerBuild and DockerPush.||May be Required|
Must specify a BuildInfo resource if
May be required
In addition, these tags can be defined to support the step's native operation:
Tags derived from Bash
All native steps derive from the Bash step. This means that all steps share the same base set of tags from Bash, while native steps have their own additional tags as well as that support the step's particular function. So it's important to be familiar with the Bash step definition, since it's the core of the definition of all other steps.
Description of usage
The name of the Docker repository in Artifactory. Required when using JFrog CLI v1 and not used when the pipeline is configured to use JFrog CLI v2.
Must be a local repository. Virtual repositories are not supported.
|May be required|
When set to
When set to
Declares collections of shell command sequences to perform for pre- and post-execution phases:
|Tag||Description of usage||Required/Optional|
|Commands to execute in advance of the native operation||Optional|
|Commands to execute on successful completion||Optional|
|Commands to execute on failed completion||Optional|
|Commands to execute on any completion||Optional|
The actions performed for the
onExecute phase are inherent to this step type and may not be overridden.
The following examples show how to configure a DockerPush step to push a Docker image.
Push Image to Artifactory
Pushes the image created by the DockerBuild input step to Artifactory. Does not trigger a scan.
- This example requires an Artifactory Integration and a GitHub Integration.
- The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.
- For a full tutorial, see Pipeline Example: Docker Build and Push.
This extends one of the DockerBuild examples, pushing that image to Artifactory. Note that an affinity group has been specified in both steps.
Publish Build Info, Trigger Xray Scan, Update Output Image Resource
In this, publishing build info, triggering an Xray scan, and updating an output Image resource has been added to the previous example.
How it Works
When you use the DockerPush native step in a pipeline, it performs the following functions in the background:
- jfrog rt use (to set the current default Artifactory configuration to the one set up for the integration in
- restore_run_files (copy the build information saved from the DockerBuild step)
- jfrog rt docker-push (push the image to Artifactory)
- jfrog rt build-publish (if
autoPublishBuildInfois true, publish the build info)
- write_output (if
autoPublishBuildInfois true, update the BuildInfo buildName and buildNumber)
- write_output (if there is an output Image resource, update the Image imageTag)
- jfrog rt build-scan (if forceXrayScan is true, trigger a scan)
- add_run_files (save/update the build information in the run state for later publish steps)