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.
- 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.
- In a browser, log in to the Registry Service user interface through the Registry Service URL.
- Click Registry Certificate to save the certificate on your machine.
- Copy the certificate in the following directory, depending on your OS.
/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.
- Login to Registry Service with the vSphere Docker Credential Helper.
docker-credential-vsphere login <container-registry-IP> --user firstname.lastname@example.orgNote: While providing
--user usernameis acceptable for login, you should use the UserPrincipalName (UPN) syntax (
--user email@example.com) to login and use
- 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]
- To push an image to a project in Harbor, run the following command:
docker push <container-registry-IP>/<namespace-name>/<image_name>
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.