Push an image to Harbor – vSphere embedded image registry

Push an image to the vSphere embedded image registry

Harbor is used to provide an image registry service to namespaces provisioned on vSphere – it can be deployed from a single click within the vSphere cluster configuration.  Once it has been deployed, you’ll be presented with a link to connect to the Harbor UI.

Login to Harbor UI using vSphere SSO credentials, browse to the project and repository you want to work with and download the Registry Certificate from the Repository.  Note that this is vSphere Harbor – so access to Harbor administration functions is not available.

Whilst there you can also view the commands required to both tag an image and push an image into this project.  Handy as we’re going to need to do that later.

When you have the certificate it’ll need to be copied into the docker certificate location on the device with docker installed.  I’m using CentOS so this location is ‘/etc/docker/certs.d’.  At that location create a directory that matches the FQDN or IP address of the vSphere image registry and copy the certificate to it.  Note that I’m not using an FQDN so the directory I need to create is for the IP ‘10.255.100.3’

We can now go back and reference those earlier commands.  As it is a useful troubleshooting tool to have available on a cluster I’m going to pull a busybox image.  Busybox combines many common UNIX utilities into a single small executable.  The steps we’re going to follow are to pull a busybox image from a public repository, tag it for use in our namespace repository, login to our vSphere image repository with Docker and the push the image to the vSphere repository.

The image is now listed in the vSphere image repository linked to the namespace simon-ns, ready to be used.

Thanks

Simon