Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Envie imagens para o Harbor e tenha mais segurança com controle de acesso baseado em função,
verificação automatizada de vulnerabilidades e gerenciamento simplificado de imagens para seus
aplicativos em contêineres. Para enviar uma imagem local a uma instância do Harbor, marque-a
com o nome do repositório e envie a imagem.
Antes de começar
Para enviar uma imagem ao Harbor, você precisa ter acesso ao seguinte:
O papel de identidade e acesso necessário. Peça ao administrador do IAM da organização para conceder a você o papel de Leitor da instância do Harbor (harbor-instance-viewer).
Defina o nome da imagem. O formato do nome completo de uma imagem é:
INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE
Substitua:
INSTANCE_URL: o URL da instância do Harbor. Por exemplo, harbor-1.org-1.zone1.google.gdc.test. Receba o URL da instância do Harbor
usando o
console do GDC ou a CLI gdcloud.
HARBOR_PROJECT_NAME: o nome do projeto do Harbor. Por exemplo, my-project.
IMAGE_NAME: o nome da imagem. Por exemplo, nginx.
Um exemplo do nome completo da imagem pode ser assim:
[[["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,["# 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/appliance/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/appliance/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/appliance/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/appliance/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/appliance/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/appliance/platform-application/pa-ao-operations/manage-harbor-instances#view-harbor-registry-instances)\nto view the image."]]