Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Esegui il push delle immagini su Harbor per una maggiore sicurezza con controllo dell'accesso basato sui ruoli,
la scansione automatica delle vulnerabilità e la gestione semplificata delle immagini per le tue
applicazioni containerizzate. Per eseguire il push di un'immagine locale in un'istanza Harbor, contrassegnala
con il nome del repository ed esegui il push dell'immagine.
Prima di iniziare
Per eseguire il push di un'immagine su Harbor, devi avere accesso a quanto segue:
Il ruolo di identità e accesso necessario. Chiedi all'amministratore IAM dell'organizzazione di concederti il ruolo Visualizzatore istanza Harbor (harbor-instance-viewer).
[[["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,["# 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."]]