Add a Docker Artifact Source

Updated 1 week ago by Michael Cretzman

This topic 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 Add Container Images for Kubernetes Deployments. For details on using Docker with Helm, see Helm Deployments Overview.

In this topic:

Before You Begin

  • Read the Create an Application topic to get an overview of how Harness organizes Services.
  • Read the Add a Service topic to understand the process to add a Service to an Application.
  • Read Configuration as Code to see how you can quickly configure your Harness Service using your existing YAML in Git.

Artifact File Sizes and Limitations

Harness has a limit of a 1GB file upload. However, Harness directly streams from the artifact server if the file size is larger (even larger than 25GB).

For artifacts larger than 1GB, use the Metadata-Only option in the Harness Service Artifact Source settings.

Step: 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.

Option 1: 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 the artifacts.

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

Option 2: 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.

Option 3: 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.

Option 4: 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.

Here is an example:

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

Option 5: 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.

Option 6: Nexus Artifact Source

See Nexus Artifact Sources.


How did we do?