Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment se connecter à Docker ou Helm à l'aide du helper d'identifiants Managed Harbor Service (MHS) ou des secrets de la CLI.
Pour plus de flexibilité, l'appliance Google Distributed Cloud (GDC) isolée fournit deux méthodes d'authentification avec Docker et Helm à partir de votre instance de registre Harbor. La première méthode consiste à utiliser le helper d'identifiants Managed Harbor Service (MHS) et votre identité GDC pour vous connecter à la Docker ou Helm CLI. Une fois authentifié auprès de GDC, vous pouvez vous connecter au client Docker et effectuer des opérations Docker, sans avoir à créer ni à gérer de secrets CLI distincts dans Harbor.
La deuxième méthode consiste à utiliser les secrets de la CLI. Après vous être authentifié à l'aide d'Identity-Aware Proxy (IAP) et vous être connecté à l'interface Harbor pour la première fois, utilisez la CLI Docker ou Helm pour accéder à Harbor. Les CLI Docker et Helm ne peuvent pas gérer la redirection pour IAP. Harbor fournit donc un secret de CLI à utiliser lors de la connexion depuis Docker ou Helm. Cette méthode n'est disponible que lorsque Harbor utilise l'authentification IAP.
Avant de commencer
Pour configurer l'authentification Docker et Helm pour les instances de registre Harbor, demandez à l'administrateur IAM de votre organisation de vous accorder le rôle Lecteur d'instance Harbor (harbor-instance-viewer).
Se connecter à Docker ou Helm avec des secrets CLI
Pour vous connecter à Docker ou Helm avec des secrets CLI, procédez comme suit :
Connectez-vous à Harbor avec un compte utilisateur IAP.
Cliquez sur votre nom d'utilisateur, puis sélectionnez Profil utilisateur.
Pour copier le secret de CLI associé à votre compte, cliquez sur content_copyCopier.
Facultatif : Pour afficher les boutons permettant de générer automatiquement ou de créer manuellement un secret CLI, cliquez sur les points de suspension more_horiz dans votre profil utilisateur.
Si vous avez généré un secret CLI, cliquez sur Copiercontent_copy pour le copier.
Vous pouvez désormais utiliser votre secret CLI comme mot de passe lorsque vous vous connectez à Harbor depuis la CLI Docker ou Helm :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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."]]