Configuring the GitLab CI/CD pipeline for a private container registry
To capture private container registry authentication details from the config.json file
After tagging and pushing the Universal Connector container image to the private container registry, log in to your private container registry. In the following example, we are using a docker image:
docker login <private container registry> --username <registryID> --password <registryPassword>To see the contents of the config.json file, run the following command:
cat /home/<LinuxUserID>/.docker/config.jsonContents of config.json file:
The contents of the config.json file is used as the value for the DOCKER_AUTH_CONFIG variable explained in the following section.
To configure a variable for the private container registry authentication
- In your GitLab Project Settings menu, select CI/CD.
- Expand Variables.
- Select Add variable.
- In the Add variable dialog box, select the following options:
- Type: Variable (default)
- Environment: All (default)
- Visibility: Visible
- Flags: Expand variable reference
- Description: Specify as desired.
- Key: DOCKER_AUTH_CONFIG
Value: Enter the private container registry authentication details found in step 2 of To capture private container registry authentication details from the config.json file.
- Click Add variable.
To configure the pipeline script
After tagging and pushing the Universal Connector container image to the private container registry and creating the GitLab CI/CD variable, define the following private container registry image:
name: <private registry>/<namespace>/<repository>:<image tag>
Variable | Description |
---|---|
Private registry | Private container registry containing the image. |
namespace | Container workspace. |
repository | Directory for image. |
image tag | Image used in the pipeline. |
For more information about GitLab CI/CD configuration options with private container registries, see the GitLab documentation.