Pull an image with Docker

Pull an image from a Harbor project in the Docker client to download the specified container image from your Harbor registry to your local machine. This lets you run the containerized application locally or use it as a base image for building other images.

Before you begin

To pull an image with Docker, 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.
  • An account with the Limited Guest role from Harbor's role-based access controls. For more information, see Configure access for APIs and within a Harbor instance.
  • An existing Harbor project. For more information, see Create Harbor projects.
  • An existing container image in the existing Harbor project.

Pull an image

Follow these steps to pull an image from a Harbor project in the Docker client:

  1. Make sure that you are authenticated to the Harbor instance.
  2. Pull the image from a Harbor project:

    docker pull INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE:TAG
    

    or

    docker pull INSTANCE_URL/HARBOR_PROJECT_NAME/IMAGE@IMAGE_DIGEST
    

Replace the following values:

  • INSTANCE_URL: the URL of the Harbor instance. For example, harbor-1.org-1.zone1.google.gdc.test. You can get the URL of the Harbor instance using the GDC console or gdcloud CLI.
  • HARBOR_PROJECT_NAME: the name of the Harbor project. For example, my-project.
  • IMAGE: the image's name. For example, nginx.
  • TAG: the tag for the image version that you want to pull. For example, staging.
  • IMAGE_DIGEST: the sha256 hash value of the image contents. Each version of an image has a unique image digest. In the Harbor instance UI, click the specific image to see its digest. For more information, see View Harbor registry instances.