Stay organized with collections
Save and categorize content based on your preferences.
Push images to Harbor for enhanced security with role-based access control,
automated vulnerability scanning, and simplified image management for your
containerized applications. To push a local image to a Harbor instance, tag it
with the repository name and then push the image.
Before you begin
To push an image to Harbor, you must have access to the following:
The necessary identity and access role. Ask your Organization IAM Admin to
grant you the Harbor Instance Viewer (harbor-instance-viewer) role.
Set the name of the image. The format of a full image name is:
INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE
Replace the following:
INSTANCE_URL: 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.
HARBOR_PROJECT_NAME: the name of the Harbor project. For example,
my-project.
IMAGE_NAME: the image's name. For example, nginx.
An example of the full image name might look like the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 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."]]