Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie können Images in Harbor übertragen, um die Sicherheit durch rollenbasierte Zugriffssteuerung, automatisches Scannen auf Sicherheitslücken und vereinfachte Imageverwaltung für Ihre containerisierten Anwendungen zu erhöhen. Um ein lokales Image in eine Harbor-Instanz per Push zu übertragen, taggen Sie es mit dem Repository-Namen und laden es dann hoch.
Hinweise
Um ein Image in Harbor zu übertragen, benötigen Sie Zugriff auf Folgendes:
Die erforderliche Identitäts- und Zugriffsrolle. Bitten Sie Ihren IAM-Administrator der Organisation, Ihnen die Rolle „Harbor Instance Viewer“ (harbor-instance-viewer) zuzuweisen.
Legen Sie den Namen des Bildes fest. Der vollständige Image-Name hat folgendes Format:
INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE
Ersetzen Sie Folgendes:
INSTANCE_URL: die URL der Harbor-Instanz. Beispiel: harbor-1.org-1.zone1.google.gdc.test Rufen Sie die URL der Harbor-Instanz mit der GDC-Konsole oder der gdcloud CLI ab.
HARBOR_PROJECT_NAME: der Name des Harbor-Projekts. Beispiel: my-project.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]