We are trying to build and push a docker image to Azure Container Registry. If we do build and push in the same step, everything works fine. But we are trying to build once and promote to all environments from that build. So, we need to build in the build stage and push in the deploy stage.
Following is the code for build step
- task: Docker@2
displayName: Build API Docker Image
inputs:
containerRegistryType: Azure Container Registry
repository: $(acrHostName)/$(imageName)
azureSubscriptionEndpoint: $(azureSubscription)
azureContainerRegistry: $(acrHostName)
tags: |
$(tag)
If I run the above code, docker adds *** in front of the image name and then it can't find the image by the tag I provide.
I have read the documentation like million times, it has something to do with hiding secret information but I am clueless as to why it can't find it.
In the picture, you can see that the image is available under the repository but not found by the docker.
imageName= onlinecalcs