Configure Docker authentication to Harbor registry instances

After you authenticate using Identity-Aware Proxy (IAP) and log into the Harbor interface for the first time, use Docker or the Helm CLI to access Harbor.

The Docker and Helm CLIs cannot handle redirection for IAP, so Harbor provides a CLI secret to use when logging in from Docker or Helm. This is only available when Harbor uses IAP authentication.

Before you begin

To configure Docker authentication to Harbor registry instances, you must have the necessary identity and access role. Ask your Organization IAM Admin to grant you the Harbor Instance Viewer (harbor-instance-viewer) role.

Configure Harbor to trust Docker or Helm

Follow these steps to use the Docker or Helm CLI:

  1. Sign in to Harbor with an IAP user account.
  2. Click your username and select User Profile.
  3. Click Copy to copy the CLI secret associated with your account.
  4. Optional: Click the ellipses in your user profile to display buttons for automatically generating or manually creating a new CLI secret.

  5. If you generated a new CLI secret, click Copy to copy it.

  6. You can now use your CLI secret as the password when logging in to Harbor from the Docker or Helm CLI:

    docker login -u USERNAME -p CLI_SECRET HARBOR_INSTANCE_URL

Replace the following:

  • USERNAME: the Harbor account username
  • CLI_SECRET: the generated CLI secret.
  • HARBOR_INSTANCE_URL: the URL of the Harbor instance.