Configure a Docker registry for use by a collective controller
When the Docker image to deploy is stored in a registry instead of locally available on the Docker host where we will deploy, we can configure the collective controller to access the registry.
Stabilized feature: Managing Docker containers using Liberty collectives is stabilized. For managing Docker containers, run our Liberty applications in IBM Cloud Pak for Applications for on-premises or bring-your-own infrastructure. For hosted environments, use Docker containers in IBM Cloud Kubernetes Service.
- If we have not done so already, complete steps 1 and 2 in Deploy Docker containers using deployment REST APIs.
- Define a Docker registry in the collective controller configuration.
In the collective controller server.xml file, add variable statements that enable connection to the Docker registry:
<!-- Docker registry connection information --> <variable name="dockerRegistryTokenURL" value="dockerRegistryTokenURL" /> <variable name="dockerRegistry" value="dockerRegistry" /> <variable name="dockerRepository" value="dockerRepository" /> <variable name="dockerUser" value="dockerUser" /> <variable name="dockerUserPassword" value="dockerUserPassword" /> <variable name="dockerUserEmail" value="dockerUserEmail" />
- dockerRegistryTokenURL is the URL to retrieve a token, for registries that use token-based login. This variable is used with the Docker registry v2 API. Specify a URL such as: https://auth.docker.io/token?service=registry.docker.io
- dockerRegistry provides the location of the Docker registry. To pull from a private registry on Docker hub, specify a URL for the registry that starts with https://.
- For Docker registry v1 API, dockerRegistry is the remote host where a user can access the Docker registry. An example value is index.docker.io/v1/. To pull from a private registry on Docker hub, specify a URL such as: https://index.docker.io/v1/
- For Docker registry v2 API, specify a URL such as: https://registry.hub.docker.com/v2
- dockerRepository is the name of the repository in the Docker registry. An example value is myNamespace/myRepo. In some implementations, the myNamespace value is the dockerUser value.
- dockerUser is the name of a user authorized to access the Docker registry.
- dockerUserPassword is the password for the user, for access to the Docker registry.
- dockerUserEmail is the email address for the user.
- Continue completing the procedure in Deploy Docker containers using deployment REST APIs.