Add a Docker Artifact Source

Updated 2 weeks ago by Michael Cretzman

This guide describes how to add a Docker Artifact Source in a Harness Service.

Do not use Docker Registry to connect to a Docker resource on Artifactory. See Artifactory.

For details on different using Docker with Kubernetes, see Kubernetes Deployments Version 2. For details on different using Docker with Helm, see Docker, Kubernetes, and Helm Deployment.

Intended Audience

  • DevOps

Before You Begin

Add a Docker Artifact Source

A Docker Image artifact can be used in a number of different Harness Service types (Kubernetes, Helm, etc). You can specify container commands for the artifact, enter configuration variables and files, and use YAML for specific Service types.

To specify a Docker Image Artifact Source for your Harness Service, do the following:

  1. In the Service Overview, click Add Artifact Source and select the type of artifact source for your service. Only the Artifact Server types that support Docker are listed.

    The Artifact Source dialog appears with settings specific to the artifact source type you selected. For instructions on the artifact source you selected, see below.
Docker Registry Artifact Source
Do not use Docker Registry to connect to a Docker resource on Artifactory. See Artifactory.

The Docker Registry Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Source Server

In Source Server, select the name of the artifact source server you added in Add an Artifact Server.

Docker Image Name

Click in Docker Image Name and select or enter the name of the artifact you want to deploy, such as library/tomcat. By default, Harness automatically populates the field with the artifacts available from the source server, but some artifact servers do not allow anyone to scan its artifacts.

If you click Artifact History you will see the build history that Harness pulled from the source server.

ECR Artifact Source

The ECR Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Cloud Provider

Select the name of the artifact source server you added in Cloud Providers.

Region

Select the region where the artifact source is located.

Docker Image Name

Click in Docker Image Name and select or enter the name of the artifact you want to deploy. By default, Harness automatically populates the field with the artifacts available from the ECR source server. Often, images in repos need to reference a path, for example: app/myImage.

If you click Artifact History you will see the build history that Harness pulled from the source server.

Azure Container Registry Artifact Source

The Azure Container Registry Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Cloud Provider

Select the name of the artifact source server you added in Cloud Providers.

Subscription

Harness will automatically pull the available GUIDs. Select an Azure Subscription GUID.

Azure Registry Name

Harness will automatically pull the available names. Select a name.

Repository Name

Harness will automatically pull the available repository names. Select a name.

If you click Artifact History you will see the build history that Harness pulled from the source server.

GCR Artifact Source

The Google Cloud Container Registry (GCR) Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Cloud Provider

Select the name of the artifact source server you added in Cloud Providers.

Registry Host Name

Once you select a cloud provider, the list of registries is populated automatically. Select the registry where the artifact source is located.

Docker Image Name

Click in Docker Image Name and select or enter the name of the artifact you want to deploy. By default, Harness automatically populates the field with the artifacts available from the GCR source server. Often, images in repos need to reference a path, for example: app/myImage.

If you click Artifact History you will see the build history that Harness pulled from the source server.

Artifactory Artifact Source

The Artifactory Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Source Server

Select the name of the artifact source server you added in Cloud Providers. The format for the cloud-based Artifactory URL is https://company_name.jfrog.io/context. For more information, see Pushing and Pulling Images from JFrog.

Repository

Select the repository where the artifact source is located.

Docker Image Name

Click in Docker Image Name and select or enter the name of the artifact you want to deploy. By default, Harness automatically populates the field with the artifacts available from the ECR source server.

Docker Repository Server

Enter the URL of the remote Docker repository server if needed. See Configuring Docker Repositories from JFrog for more information. It describes the URLs for local, remote, and virtual repositories.

For example, a remote Docker repository URL follows the syntax http://my-remote-site:8081/artifactory/api/docker/<repository key>.

If you click Artifact History you will see the build history that Harness pulled from the source server.

Nexus Artifact Source

The Nexus Artifact Source has the following fields.

Field

Description

Name

You can enter a name of have Harness generate one for you automatically.

Source Server

Select the name of the artifact source server you added in Cloud Providers.

Repository

Select the name of the repository where the artifact is located.

Docker Image Name

Click in Docker Image Name and select or enter the name of the artifact you want to deploy. By default, Harness automatically populates the field with the artifacts available from the ECR source server.

Docker Port

Enter the port number to pull from the Docker repo. Typically, 8083. For more information, see Using Nexus 3 as Your Repository – Part 3: Docker Images from Sonatype.

If you click Artifact History you will see the build history that Harness pulled from the source server.


How did we do?