Docker Registry Integration

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

The Docker Registry Integration is used to connect the JFrog Pipelines platform to Docker Hub, Docker Trusted Registry, or a Docker registry in Artifactory so that you can pull and push Docker images.

Creating a Docker Registry Integration

You can add this integration by following steps on the Managing Pipelines Integrations page.

Here is the information you need to create this integration:

  • Name -- choose a friendly name for the integration

  • url -- an optional field that defaults to Docker Hub if left empty. To use with Docker Trusted Registry or Docker Private Registry, enter the location of your private registry. Format https://foo.com

  • User Name -- username of your Docker Registry Account

  • Password -- password of your Docker Registry Account

Usage

The Docker Registry integration can be used in the Image resource.

The Docker Registry integration can also be added directly to a step in the integrations section. This automatically configures the Docker CLI with access to the registry.

Default Environment Variables

When you create a resource with this integration, and create a step that uses it, a set of environment variables is automatically made available.

Environment variable

Description

res_<resource-name>_registry_url

URL supplied in the integration

res_<resource-name>_registry_username

Username supplied in the integration

res_<resource-name>_registry_password

Password supplied in the integration

When you add this integration directly to a step, a set of environment variables is automatically made available.

Environment variable

Description

int_<integration-name>_url

URL supplied in the integration

int_<integration-name>_username

Username supplied in the integration

int_<integration-name>_password

Password supplied in the integration

Example

  • This example uses a Docker Registry integration named myDocker, which is used in the Image_1 resource.

  • The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.

resources:  
  - name: Image_1
    type: Image 
    configuration:         
      registry: myDocker              
      imageName: docker/jfreq_win             
      imageTag: latest  
      autoPull: true

pipelines:
  - name: pipelines_Image_1
    steps:
      - name: step_Image_1
        type: PowerShell
        configuration:
          nodePool: win_2019
          inputResources:
            - name: Image_1
        execution:
          onExecute:
            - write_output "executing step..."
            - if($Image_1_isTrigger -ne "true"){
              Write-Error "Stop" -ErrorAction Stop
              }