Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Envía imágenes a Harbor para mejorar la seguridad con el control de acceso basado en roles, el análisis automatizado de vulnerabilidades y la administración simplificada de imágenes para tus aplicaciones en contenedores. Para enviar una imagen local a una instancia de Harbor, etiquétala con el nombre del repositorio y, luego, envíala.
Antes de comenzar
Para enviar una imagen a Harbor, debes tener acceso a lo siguiente:
El rol de identidad y acceso necesario. Pídele al administrador de IAM de la organización que te otorgue el rol de visualizador de instancias de Harbor (harbor-instance-viewer).
Establece el nombre de la imagen. El formato de un nombre de imagen completo es el siguiente:
INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE
Reemplaza lo siguiente:
INSTANCE_URL: Es la URL de la instancia de Harbor. Por ejemplo, harbor-1.org-1.zone1.google.gdc.test Obtén la URL de la instancia de Harbor con la consola de GDC o la CLI de gdcloud.
HARBOR_PROJECT_NAME: Es el nombre del proyecto de Harbor. Por ejemplo: my-project..
IMAGE_NAME: Es el nombre de la imagen. Por ejemplo, nginx.
Un ejemplo del nombre completo de la imagen podría verse de la siguiente manera:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003ePushing images to Harbor enhances security through role-based access control, automated vulnerability scanning, and simplified image management.\u003c/p\u003e\n"],["\u003cp\u003eBefore pushing an image, you must have the \u003ccode\u003eharbor-instance-viewer\u003c/code\u003e role, a \u003ccode\u003eDeveloper\u003c/code\u003e account in Harbor, and an existing Harbor project.\u003c/p\u003e\n"],["\u003cp\u003eTag a local image with the format \u003ccode\u003eINSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE:TAG\u003c/code\u003e, ensuring you are authenticated to the Harbor instance.\u003c/p\u003e\n"],["\u003cp\u003eAfter tagging the image, use the \u003ccode\u003edocker push\u003c/code\u003e command with the full image name to store the image in the specified Harbor instance and project.\u003c/p\u003e\n"]]],[],null,["# Push an image\n\nPush images to Harbor for enhanced security with role-based access control,\nautomated vulnerability scanning, and simplified image management for your\ncontainerized applications. To push a local image to a Harbor instance, tag it\nwith the repository name and then push the image.\n\nBefore you begin\n----------------\n\nTo push an image to Harbor, 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 `Developer` 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\nTag the local image\n-------------------\n\nFollow these steps to tag a local image with the repository name:\n\n1. You must be authenticated to the Harbor instance. For more information, see [Configure Docker authentication to Harbor registry instances](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/configure-docker-authentication).\n2. Set the name of the image. The format of a full image name is:\n\n \u003cvar translate=\"no\"\u003eINSTANCE_URL\u003c/var\u003e/\u003cvar translate=\"no\"\u003eHARBOR_PROJECT_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e\n\n Replace the following:\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`. Get the URL of the Harbor instance using [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_NAME\u003c/var\u003e: the image's name. For example, `nginx.`\n\n An example of the full image name might look like the following: \n\n harbor-1.org-1.zone1.google.gdc.test/my-project/nginx\n\n3. Tag the local image with the repository name:\n\n docker tag \u003cvar translate=\"no\"\u003eSOURCE-IMAGE\u003c/var\u003e\n \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\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSOURCE-IMAGE\u003c/var\u003e: the local image name or image ID. For example, `nginx`.\n- \u003cvar translate=\"no\"\u003eTAG\u003c/var\u003e: the tag name. For example, `staging`. If you don't specify a tag, Docker applies the latest tag by default.\n\nPush the tagged image to a Harbor registry instance\n---------------------------------------------------\n\nAfter the image is tagged, push it to the Harbor registry instance:\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. Push the tagged image with the command:\n\n docker push\n \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\nWhen you push an image, it is stored in the specified instance and Harbor\nproject.\n\nAfter pushing your image, go to the\n[Harbor instance UI](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/manage-harbor-instances#view-harbor-registry-instances)\nto view the image."]]