Sign in to Docker and Helm

This page describes how to sign in to Docker or Helm using the Managed Harbor Service (MHS) credential helper or CLI secrets.

To provide flexibility, Google Distributed Cloud (GDC) air-gapped appliance provides two methods to authenticate with Docker and Helm from your Harbor registry instance. The first method is using the Managed Harbor Service (MHS) credential helper and your GDC identity to sign in to the Docker or Helm CLI. After authenticating with GDC, you can sign in to the Docker client and perform Docker operations, without having to create or manage separate CLI secrets in Harbor.

The second method is using CLI secrets. After you authenticate using Identity-Aware Proxy (IAP) and sign in to the Harbor interface for the first time, use the Docker or Helm CLI to access Harbor. The Docker and Helm CLIs cannot handle redirection for IAP, so Harbor provides a CLI secret to use when signing in from Docker or Helm. This method is only available when Harbor uses IAP authentication.

Before you begin

  • To configure Docker and Helm authentication for Harbor registry instances, ask your Organization IAM Admin to grant you the Harbor Instance Viewer (harbor-instance-viewer) role.

Sign in to Docker or Helm with CLI secrets

To sign in to Docker or Helm with CLI secrets, follow these steps:

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

  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 signing 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.