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

Docker

spinner

Prerequisites

  • Ensure you have Docker CLI installed and configured on your local machine.

  • Access to a Harness account with appropriate permissions to create registries and connectors. 


Create a Docker Artifact Registry

Create a Docker Artifact Registry in Harness
  1. Navigate to the Artifact Registry module in your Harness project.

  2. Click on New Artifact Registry.

  3. In the Registry Type dropdown, select Docker Registry.

  4. Provide a Registry Name.

    • Your registry name must start with a letter and can include lowercase alphanumerics, _, . and -.

  5. Optionally, add a Description and Labels for better organization.

  6. Choose visibility between Public and Private.

  7. Click Create Registry to finalize.

PRIVATE DOCKER REGISTRY

This registry will serve as your private Docker registry within Harness.


Configure an Upstream Proxy (Optional)

An upstream proxy allows your registry to fetch Docker images from external sources if they are not available locally.

Create an upstream proxy

Create Upstream Proxy Configuration

Configure the upstream proxy in your registry

Configure Upstream in Docker Registry

Create an upstream proxy

1. In the Artifact Registry module, click the dropdown next to **New Artifact Registry** and select **Upstream Proxy**. 2. Choose **Docker Registry** as the proxy type. 3. Click **Create Proxy** to establish the connection.

Configure the upstream proxy in your registry

1. In the Artifact Registry module, select an existing Artifact Registry. 2. Select the **Configuration** tab. 3. Under **Advanced (Optional)**, select **Configure Upstream**. 4. Select from the list of compatible proxies to add them to your registry. 5. Click **Save** to save the configuration.

UPSTREAM PROXY CACHING

If a Docker image isn’t found in your Harness registry, the upstream proxy fetches it from an external registry like Docker Hub, reducing duplication and improving image resolution.


Push & Pull Docker images

Authenticate the Docker CLI with Harness Registry

  1. In your Harness Docker Artifact Registry, click Setup Client.

  2. Copy the provided docker login command.

  3. Execute the command in your terminal to authenticate your Docker CLI with the Harness registry. 

Push a Docker Image to Harness Registry

  1. Tag your Docker image to match the Harness registry format:

  1. Push the image to the Harness registry:

Replace <harness-registry-url> with the URL of your Harness Docker registry.

Pull a Docker Image from Harness Registry

  1. Ensure you’re authenticated with the Harness registry (see Step 3).

  2. Pull the desired image:

DOCKER PULL COMMAND

This command retrieves the Docker image from your Harness registry to your local environment.


Last updated

Was this helpful?