I'm following this guide to build, and then push image to ACR. But image name is not evaluated properly during push step, so I end up with the following message:
2018-10-15T02:28:11.4805747Z An image does not exist locally with the tag: blablabla.azurecr.io/postgres
I run 'docker images', so I can see the image with tag exist, so somehow imageName is resolved normally during build step, but resolution of variable value in push step doesn't work correctly.
My pipeline configuration:
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
All right, I resolved it. But docs should be fixed anyway.
So, to push to private docker registry you will need to tag it as <dockerRegistry>/<image>:<tag>.
@ahanoff Can you share your build and push scriptlets, so that we can validate how to document this? The doc primarily covers Azure container register and Dockerhub. It looks like you are using a private docker registry, and that is not well represented in the doc.
@vijayma
In docs we see:
dockerId: Your Docker Id for DockerHub or the admin user name for the Azure Container Registry
Then instructions to build:
script: docker build -t $(dockerId)/$(dockerImage) . # include other options to meet your needs
And then your instructions to push:
To push the image to Azure Container Registry, use the following snippet:
- script: |
docker login -u $(dockerId) -p $(pswd) $(dockerId).azurecr.io
docker push $(dockerId).azurecr.io/$(imageName)
So if you repeat those steps, you will not be able to push. Either change dockerId variable to be ACR server url instead of username or fix the build/push scripts. Thanks
Thanks, doc fix going out soon.
I would have loved that doc fix hours ago when I ran into the issue above.
Also, for versions of asp .net core > 2.0 you will need to use the microsoft/dotnet image with the appropriate asp.net core tag. An update to the docs would be helpful.
Most helpful comment
All right, I resolved it. But docs should be fixed anyway.
So, to push to private docker registry you will need to tag it as
<dockerRegistry>/<image>:<tag>.