When pushing containers into a private Azure Container Registry using Docker Compose the Azure DevOps pipeline returns the following error:
Pushing [container] ([registry]/[app]:latest)...
The push refers to repository [docker.io/[registry]/[container]]
denied: requested access to the resource is denied
The azure-pipeline.yml
file is taken from the Docker Compose example shown in the Microsoft Microservices eShopOnContainer example, here:
variables:
azureContainerRegistry: myregistry
azureSubscriptionEndpoint: My Service Principle
...
task: DockerCompose@0
displayName: Compose push customer API
inputs:
containerregistrytype: Azure Container Registry
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureContainerRegistry: $(azureContainerRegistry)
dockerComposeCommand: 'push [container]'
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
The service principle is in the AcrPush role.