Configuring the Azure DevOps pipeline for a private container registry
Follow these steps to configure a service connection in Azure DevOps:
- In your Azure DevOps project, select Project Settings > Service connections.
- Click New service connection.
- Select Docker Registry.
- Scroll to the end of the list and click Next.
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
- Click Save.
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.