Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Extrayez une image d'un projet Harbor dans le client Docker pour télécharger l'image de conteneur spécifiée depuis votre registre Harbor vers votre ordinateur local. Cela vous permet d'exécuter l'application conteneurisée en local ou de l'utiliser comme image de base pour créer d'autres images.
Avant de commencer
Pour extraire une image avec Docker, vous devez avoir accès aux éléments suivants :
Le rôle d'identité et d'accès nécessaire. Demandez à votre administrateur IAM de l'organisation de vous attribuer le rôle Lecteur d'instance Harbor (harbor-instance-viewer).
INSTANCE_URL : URL de l'instance Harbor. Par exemple, harbor-1.org-1.zone1.google.gdc.test. vous pouvez obtenir l'URL de l'instance Harbor à l'aide de la console GDC ou de la CLI gdcloud.
HARBOR_PROJECT_NAME : nom du projet Harbor. Exemple : my-project.
IMAGE : nom de l'image. Exemple :nginx
TAG : tag de la version de l'image que vous souhaitez extraire. Exemple : staging.
IMAGE_DIGEST : valeur de hachage sha256 du contenu de l'image. Chaque version d'une image possède un condensé d'image unique. Dans l'UI de l'instance Harbor, cliquez sur l'image spécifique pour afficher son condensé. Pour en savoir plus, consultez Afficher les instances du registre Harbor.
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)."],[[["\u003cp\u003ePulling an image from a Harbor project in Docker downloads a specified container image from the Harbor registry to your local machine.\u003c/p\u003e\n"],["\u003cp\u003eYou must have the Harbor Instance Viewer role and a Limited Guest account in Harbor to pull images.\u003c/p\u003e\n"],["\u003cp\u003eEnsure you have an existing Harbor project and a container image within that project before attempting to pull it.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003edocker pull\u003c/code\u003e command, along with the correct instance URL, project name, image name, and tag or digest, to pull an image.\u003c/p\u003e\n"]]],[],null,["# Pull an image with Docker\n\nPull an image from a Harbor project in the Docker client to download the\nspecified container image from your Harbor registry to your local machine. This\nlets you run the containerized application locally or use it as a base\nimage for building other images.\n\nBefore you begin\n----------------\n\nTo pull an image with Docker, you must have access to the following:\n\n- The necessary identity and access role. Ask your Organization IAM Admin to grant you the Harbor Instance Viewer (`harbor-instance-viewer`) role.\n- An account with the `Limited Guest` role from Harbor's role-based access controls. For more information, see [Configure access for APIs and within a Harbor instance](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/configure-access-control#configure-access-within-harbor-instance).\n- An existing Harbor project. For more information, see [Create Harbor projects](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/create-harbor-projects).\n- An existing container image in the existing Harbor project.\n\nPull an image\n-------------\n\nFollow these steps to pull an image from a\nHarbor project in the Docker client:\n\n1. Make sure that you are [authenticated](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/configure-docker-authentication) to the Harbor instance.\n2. Pull the image from a Harbor project:\n\n docker pull \u003cvar translate=\"no\"\u003eINSTANCE_URL\u003c/var\u003e/\u003cvar translate=\"no\"\u003eHARBOR_PROJECT_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e:\u003cvar translate=\"no\"\u003eTAG\u003c/var\u003e\n\n or \n\n docker pull \u003cvar translate=\"no\"\u003eINSTANCE_URL\u003c/var\u003e/\u003cvar translate=\"no\"\u003eHARBOR_PROJECT_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e@\u003cvar translate=\"no\"\u003eIMAGE_DIGEST\u003c/var\u003e\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_URL\u003c/var\u003e: the URL of the Harbor instance. For example, `harbor-1.org-1.zone1.google.gdc.test.` You can get the URL of the Harbor instance using the [GDC console or gdcloud CLI](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/manage-harbor-instances#view-harbor-registry-instances).\n- \u003cvar translate=\"no\"\u003eHARBOR_PROJECT_NAME\u003c/var\u003e: the name of the Harbor project. For example, `my-project`.\n- \u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e: the image's name. For example, `nginx`.\n- \u003cvar translate=\"no\"\u003eTAG\u003c/var\u003e: the tag for the image version that you want to pull. For example, `staging`.\n- \u003cvar translate=\"no\"\u003eIMAGE_DIGEST\u003c/var\u003e: the sha256 hash value of the image contents. Each version of an image has a unique image digest. In the Harbor instance UI, click the specific image to see its digest. For more information, see [View Harbor registry instances](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/manage-harbor-instances#view-harbor-registry-instances)."]]