Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, descrevemos como fazer login no Docker ou no Helm usando o assistente de credenciais do Managed Harbor Service (MHS) ou segredos da CLI.
Para oferecer flexibilidade, o appliance isolado do Google Distributed Cloud (GDC) oferece dois métodos para autenticar com o Docker e o Helm na instância do registro do Harbor. O primeiro método usa o auxiliar de credenciais do Managed Harbor Service (MHS) e sua identidade do GDC para fazer login na CLI do Docker ou do Helm. Depois de se autenticar com o GDC, é possível fazer login no cliente do Docker e realizar operações do Docker sem precisar criar ou gerenciar segredos separados da CLI no Harbor.
O segundo método é usar secrets da CLI. Depois de se autenticar usando o Identity-Aware Proxy (IAP) e fazer login na interface do Harbor pela primeira vez, use a CLI do Docker ou do Helm para acessar o Harbor. As CLIs do Docker e do Helm não podem processar o redirecionamento para o IAP. Por isso, o Harbor fornece um secret da CLI para usar ao fazer login no Docker ou no Helm. Esse método só está disponível quando o Harbor usa a autenticação do IAP.
Antes de começar
Para configurar a autenticação do Docker e do Helm para instâncias do registro do Harbor,
peça ao administrador do IAM da organização para conceder a você o papel de Leitor de instâncias do Harbor
(harbor-instance-viewer).
Fazer login no Docker ou no Helm com secrets da CLI
Para fazer login no Docker ou no Helm com segredos da CLI, siga estas etapas:
Faça login no Harbor com uma conta de usuário do IAP.
Clique no seu nome de usuário e selecione Perfil de usuário.
Para copiar o segredo da CLI associado à sua conta, clique em content_copyCopiar.
Opcional: para mostrar botões para gerar automaticamente ou criar manualmente um novo secret da CLI, clique nas reticências more_horiz no seu perfil de usuário.
Se você gerou uma nova chave secreta da CLI, clique em content_copyCopiar para copiar.
Agora é possível usar o secret da CLI como senha ao fazer login no
Harbor pela CLI do Docker ou do Helm:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[],[],null,["# Sign in to Docker and Helm\n\nThis page describes how to sign in to Docker or Helm using the Managed Harbor Service (MHS) credential helper or CLI secrets.\n\nTo 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.\n\nThe 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.\n\nBefore you begin\n----------------\n\n- 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.\n\nSign in to Docker or Helm with CLI secrets\n------------------------------------------\n\nTo sign in to Docker or Helm with CLI secrets, follow these steps:\n\n1. Sign in to Harbor with an IAP user account.\n2. Click your username and select **User Profile**.\n3. To copy the CLI secret associated with your account, click content_copy **Copy**.\n4. Optional: To display buttons for\n automatically generating or manually creating a new CLI secret, click the more_horiz ellipses in your user profile.\n\n | **Note:** A user can only have one CLI secret. When a new secret is generated or created, the old secret becomes invalid.\n5. If you generated a new CLI secret, click content_copy **Copy** to copy it.\n\n6. You can now use your CLI secret as the password when signing in to\n Harbor from the Docker or Helm CLI:\n\n docker login -u \u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e -p \u003cvar translate=\"no\"\u003eCLI_SECRET\u003c/var\u003e \u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e: the Harbor account username\n- \u003cvar translate=\"no\"\u003eCLI_SECRET\u003c/var\u003e: the generated CLI secret.\n- \u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e: the URL of the Harbor instance.\n\n| **Note:** The CLI secret does not expire, unless you manually rotate it. The CLI secret is not associated with the user identity token. Signing out from Harbor or the GDC console does not revoke the CLI secret."]]