Configuring the GitLab CI/CD pipeline for a private container registry


To capture private container registry authentication details from the config.json file

  1.  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>
  2. To see the contents of the config.json file, run the following command:


    cat /home/<LinuxUserID>/.docker/config.json

    Contents of config.json file:

    Example
    {
            "auths": {
                    "https://index.<private container registry>/": {
                            "auth": "<token>"   
                    }
            }
    }

    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

  1. In your GitLab Project Settings menu, select CI/CD.
  2. Expand Variables.
  3. Select Add variable.
  4. 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.

      Example
      {
              "auths": {
                      "https://index.<private container registry>/": {
                              "auth": "<token>"   
                      }
              }
      }
  5. 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:

image:attach:xwiki:Mainframe.Data-for-Db2.BMC-AMI-SQL-Assurance-for-Db2.COB13100.Installing.Configuring-the-GitLab-pipeline-for-a-private-container-registry.WebHome@filename
  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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*