For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect to IBM cloud container registry

Connect Harness to IBM Cloud Container Registry using a Harness Docker Registry connector.

You can connect Harness to IBM Cloud Container Registry using a Harness Docker Registry connector. The connector uses your IBM Cloud credentials to push and pull images in Harness pipelines.


What you will learn from this topic


Before you begin

Review the following before you connect Harness to IBM Cloud Container Registry:

  • CI key concepts: Understand the building blocks of Harness CI pipelines. Go to CI key concepts.

  • Delegate overview: Learn how Harness uses delegates to communicate with external systems. Go to Delegate overview.


Add a Docker Registry connector

Perform the following steps to generate an IBM Cloud API key and add a Docker Registry connector in Harness.

Review IAM policies in IBM Cloud

If the IBM Cloud IAM role used by your Docker Registry connector does not have the policies required by the IBM service you want to access, you can modify or switch the role.

Go to Defining access role policies from IBM to set up and manage IAM policies.

When you switch or modify the IAM role, it might take up to 5 minutes to take effect.


Step 1: Generate an API key in IBM Cloud Console

Follow the instructions outlined in Creating an API Key from IBM.

After the API key is generated, click Copy or Download the API key.

Generate an API key in the IBM Cloud console

Step 2: Create a Docker Registry connector in Harness

You can create the Docker Registry connector at the Harness account, org, or project level. This procedure covers the project level, and the process is the same for org and account.

Perform the following steps to create a Docker Registry connector:

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. Click New Connector, and under Artifact Repositories click Docker Registry. The Docker Registry settings appear.

    New Connector dialog with Docker Registry selected under Artifact Repositories
  4. In Name, enter a name for this connector.

    Docker Registry connector Name field

    Harness automatically creates the corresponding Id (entity identifier).

  5. Click Continue.


Step 3: Enter credentials

In this step, enter the API key you generated in IBM Cloud.

Docker Registry connector credentials form

Enter the following credentials:

Field

Description

Docker Registry URL

Enter the IBM Cloud Container Registry API endpoint URL. For example: https://us.icr.io. Go to IBM Cloud Container Registry from IBM to find the endpoint URL for your region.

Provider Type

Select Other (Docker V2 compliant).

Authentication

Select Username and Password.

Username

Enter iamapikey. Go to Authentication from IBM to understand how the API key authenticates with the registry.

Password

In Password, click Create or Select a Secret. In the new secret, in Secret Value, enter the API key generated in Step 1.

Docker Registry connector Save and Continue buttons

Click Save, then click Continue.


Step 4: Select connectivity mode

Under Select Connectivity Mode, select how you want Harness to connect to IBM Cloud Container Registry:

  • Connect through Harness Platform: Use a direct, secure connection between Harness and IBM Cloud Container Registry. Use this option with Harness Cloud build infrastructure.

  • Connect through a Harness Delegate: Harness communicates with Docker through a Harness Delegate. For delegate installation instructions, go to Delegate installation overview.

Click Continue.


Step 5: Set up delegates

Harness uses Docker Registry connectors at pipeline runtime to authenticate and perform operations with IBM Cloud Container Registry. Authentications and operations are performed by Harness delegates.

If you select Connect through a Harness Delegate, you can select any available Harness delegate and Harness selects the delegate for you. For a description of how Harness picks delegates, go to Delegates overview.

You can use delegate tags to select one or more delegates. For details on delegate tags, go to Use delegate selectors.

If you need to install a delegate, go to Delegate installation overview.

Click Save and Continue.


Step 6: Verify the connection

Harness tests the credentials you provided using the delegates you selected.

Test connection result for the Docker Registry connector

If the credentials fail, you see an error. Click Edit Credentials to modify your credentials.

Click Finish.


Next steps

Last updated

Was this helpful?