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 using Docker with Kubernetes, see Kubernetes Deployments Version 2. For details on using Docker with Helm, see Docker, Kubernetes, and Helm Deployment.

In this topic:

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 or 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 or 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 or 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. If you don't see it, the API might have timed out. Enter the GUID and Harness will query for it.

Azure Registry Name

Harness will automatically pull the available names. Select a name. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

Repository Name

Harness will automatically pull the available repository names. Select a name. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

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

Display Name

You can enter a name or 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

Enter the name of the artifact you want to deploy. Images in repos need to reference a path starting with the project ID that the artifact is in, for example: myproject-id/app/image-name.

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 or have Harness generate one for you automatically.

Source Server

Select the name of the artifact source server you added in Add Artifact Servers. 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. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

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 Artifactory source server. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

Docker Repository Server

Enter the name of the server from the docker login command. For example:

If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

See Configuring Docker Repositories from JFrog for more information. It describes the URLs for local, remote, and virtual repositories.

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 or have Harness generate one for you automatically.

Source Server

Select the name of the artifact source server you added in Add Artifact Servers.

Repository Format

Select the Nexus format for your repo, such as Maven.

Repository

Select the name of the repository where the artifact is located. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

Group ID

Select the repo group for your artifact. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

Artifact ID

Select the artifact in the repository. If you don't see it, the API might have timed out. Enter its name and Harness will query for it.

Extension

Filter the artifacts by extension, such as war.

Classifier

Filter the artifact by classifier, such as sources.

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 source server.`

Docker Registry URL

Enter the URL for the Nexus Docker registry, known as the Docker Repository Connector in Nexus. This is the same as the domain name and port you use for docker login hostname:port. As a best practice, include the scheme and port, for example https://your-repo:443. If you cannot locate the scheme, you may omit it, for example your-repo:18080.

For more information, see Docker Repository Configuration and Client Connection and 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.

Here is an example of the Nexus repo settings and how they are used in the Nexus Artifact Source:


How did we do?