Use the vSphere Docker Credential Helper CLI to securely push container images to and pull container images from the embedded Harbor Registry.
The Kubernetes CLI Tools download page includes a link to download the vSphere Docker Credential Helper. Use the vSphere Docker Credential Helper to securely connect your Docker client to the embedded Harbor Registry.
- Enable the Embedded Harbor Registry on the Supervisor Cluster
- Get the link to the Kubernetes CLI Tools for vSphere download page from your vSphere administrator.
- Alternatively, if you have access to the vCenter Server, get the link as follows:
- Log in to the vCenter Server using the vSphere Client.
- Navigate to vSphere Namespace where you are working. and select the
- Select the tab and locate the tile.
- Select Open beneath the heading to open the download page. Or, you can Copy the link.
- Configure a Docker client. See Configure a Docker Client with the Embedded Harbor Registry Certificate.
- Using a browser, navigate to the Kubernetes CLI Tools download URL for your environment.
- Scroll down to the vSphere Docker Credential Helper section.
- Select the operating system.
- Download the
- Extract the contents of the ZIP file to a working directory.
The docker-credential-vsphere binary executable is available.
- Copy the docker-credential-vsphere binary to your Docker client host.
- Add the location of the binary to your system PATH.
For example, on Linux:
mv docker-credential-vsphere /usr/local/bin/docker-credential-vsphere
- Verify the installation of the vSphere Docker Credential Helper by running the command
docker-credential-vspherein a shell or terminal session.You see the banner message, and the list of command-line options for the CLI.
vSphere login manager is responsible for vSphere authentication. It allows vSphere users to securely login and logout to access Harbor images. Usage: docker-credential-vsphere [command] Available Commands: help Help about any command login Login into specific harbor server and get authentication logout Logout from Harbor server and erase user token Flags: -h, --help help for docker-credential-vsphere Use "docker-credential-vsphere [command] --help" for more information about a command.
- Log in to the embedded Harbor Registry.
First, check the usage:
docker-credential-vsphere login -help Usage: docker-credential-vsphere login [harbor-registry] [flags] Flags: -h, --help help for login -s, --service string credential store service --tlscacert string location to CA certificate (default "/etc/docker/certs.d/*.crt") -u, --user string vSphere username and passwordThen, log in using the following command:
docker-credential-vsphere login <container-registry-IP>The authentication token is fetched and saved, and you are logged in.
docker-credential-vsphere login 10.179.145.77 Username: firstname.lastname@example.org Password: INFO Fetched username and password INFO Fetched auth token INFO Saved auth token
- Log out of the embedded Harbor Registry.
docker-credential-vsphere logout 10.179.145.77