Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come accedere a Docker o Helm utilizzando l'helper delle credenziali Managed Harbor Service (MHS) o i secret della CLI.
Per offrire flessibilità, l'appliance air-gap Google Distributed Cloud (GDC) fornisce due metodi per l'autenticazione con Docker e Helm dall'istanza del registro Harbor. Il primo metodo consiste nell'utilizzare l'helper delle credenziali del servizio Managed Harbor (MHS) e la tua identità GDC per accedere alla CLI Docker o Helm. Dopo l'autenticazione con GDC, puoi accedere al client Docker ed eseguire operazioni Docker, senza dover creare o gestire segreti CLI separati in Harbor.
Il secondo metodo consiste nell'utilizzare i secret della CLI. Dopo l'autenticazione tramite Identity-Aware Proxy (IAP) e l'accesso all'interfaccia di Harbor per la prima volta, utilizza la CLI Docker o Helm per accedere a Harbor. Le CLI Docker e Helm non possono gestire il reindirizzamento per IAP, quindi Harbor fornisce un secret CLI da utilizzare per l'accesso da Docker o Helm. Questo metodo è disponibile solo quando Harbor utilizza l'autenticazione IAP.
Prima di iniziare
Per configurare l'autenticazione Docker e Helm per le istanze del registro Harbor, chiedi all'amministratore IAM dell'organizzazione di concederti il ruolo Visualizzatore istanza Harbor (harbor-instance-viewer).
Accedi a Docker o Helm con i secret della CLI
Per accedere a Docker o Helm con i secret della CLI:
Accedi a Harbor con un account utente IAP.
Fai clic sul tuo nome utente e seleziona Profilo utente.
Per copiare il secret della CLI associato al tuo account, fai clic su content_copyCopia.
(Facoltativo) Per visualizzare i pulsanti per generare automaticamente o creare manualmente un nuovo secret CLI, fai clic sui puntini di sospensione more_horiz nel tuo profilo utente.
Se hai generato un nuovo secret CLI, fai clic su content_copyCopia per copiarlo.
Ora puoi utilizzare il secret della CLI come password quando accedi ad Harbor dalla CLI Docker o Helm:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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."]]