Configuring the Azure DevOps pipeline for a private container registry


This topic describes how to configure the Azure DevOps pipeline for a private container registry.

Follow these steps to configure a service connection in Azure DevOps:

  1. In your Azure DevOps project, select Project Settings > Service connections.
  2. Click New service connection.
  3. Select Docker Registry.
  4. Scroll to the end of the list and click Next.
  5. Select the Others registry type, and enter the following values for your site:

    Field

    Value

    Docker Registry

    Container registry host name

    Docker ID

    Registered user ID

    Docker Password

    Registered user password or token

    Service connection name

    Name for the service connection

  6. Click Save.
  7. After downloading the Universal Connector container image and creating the service connection, define the resource container in your pipeline script with the following script:

    resources:
      containers:
      - container: <containerName>
        image: <newTag>
        endpoint: <serviceConnectionName>
        options: -u root 
    pool: <poolName>

    Variable

    Description

    containerName

    Any valid name for the container generated from the pulled image. This name will be used in the job section of the pipeline script.

    newTag

    Image to be used in pipeline.

    serviceConnectionName

    Service connection that you have created to perform docker login to your private container registry.

    poolName

    Name for the agent pool to which you have added the self-hosted Azure DevOps agent that will run the Azure DevOps pipeline.

 

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