You can push images from Docker to a project on Registry Service. Projects in Registry Service correspond to namespaces on a Supervisor Cluster on vSphere with Tanzu.

Prerequisites

  • Verify that Registry Service is enabled on the Supervisor Cluster.
  • Obtain the URL to the Registry Service user interface from your vSphere admin.
  • Obtain your user account for which you have write permissions on the namespace that corresponds to the project on Registry Service where you want to push images.
  • Get the IP address of the Kubernetes control plane on the Supervisor Cluster from your vSphere administrator.
  • Download the vSphere Docker Credential Helper plug-in from the page of the Kubernetes control plane and configure the plug-in on the executable file path of your system.

Procedure

  1. In a browser, log in to the Registry Service user interface through the Registry Service URL.
  2. Click Registry Certificate to save the certificate on your machine.
  3. Copy the certificate in the following directory, depending on your OS.
    • Linux
      /etc/docker/certs.d/<Container Registry IP>
    • Mac OS
      security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain ca.crt

      Once the import is complete, restart Docker.

  4. Login to Registry Service with the vSphere Docker Credential Helper.
    docker-credential-vsphere login <container-registry-IP> --user username@domain.com
    Note: While providing --user username is acceptable for login, you should use the UserPrincipalName (UPN) syntax ( --user username@domain.com) to login and use docker push commands.
  5. Tag the image that you want to push to the project in Registry Service with same name as the namespace, where you want to use it:
    docker tag <image-name>[:TAG] <container-registry-IP>/<project-name>/<image-name>[:TAG]
    
  6. To push an image to a project in Harbor, run the following command:
    docker push <container-registry-IP>/<namespace-name>/<image_name>

Example

Push the following image to Harbor image registry:
docker tag busybox:latest <container-registry-IP>/<namespace-name>/busybox:latest
docker push <container-registry-IP>/busybox/busybox:latest

What to do next

Deploy vSphere Pods by using images from the Harbor registry.