Skip to main content

docker-quickstart

This guide will help you create a Docker Artifact Registry in Harness, configure an upstream proxy, and manage Docker images.

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

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

Configure the upstream proxy in your registry

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:
docker tag your-image:tag <harness-registry-url>/your-image:tag
  1. Push the image to the Harness registry:
docker push <harness-registry-url>/your-image:tag

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 <harness-registry-url>/your-image:tag
docker pull command

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


By following this guide, you can effectively set up and manage a Docker Artifact Registry within Harness, streamlining your container image workflows.