DEV Community


Fix: Azure DevOps “An image does not exist locally with the tag”

seankilleen profile image Sean Killeen Originally published at on ・1 min read

I was working on a livestream recently when I ran into an issue attempting to push a docker container to a private registry in Azure DevOps.


Upon attempting to push the container to my container registry, I received the error:

[error]An image does not exist locally with the tag: ***/konmaripoweb

This is weird, because this tag should be happening automatically. Something wasn’t matching up.


The fix in this case actually has to do with how the Azure DevOps tasks work, in particular the Docker@2 task that I was working with.

I pulled the repo and looked into the DockerV2 task’s source code to find the solution.

I noticed that in the build and publish tasks specify a registry name if the containerRegistry value is set or the service connection exists. My publish step was specifying this attribute, but my build step was not.

I modified the build step to also pass in this parameter, and the correct tags were created across both steps to resolve the issue.

Happy (containerized) coding!

Discussion (4)

Editor guide
shashankkr profile image
Shashank Kumar

Hi Sean,
I am also having the same problem except - I am pulling the image from one container registry and pushing it to another. Pull works fine but the push fails with the same error. Can you provide some screenshots for your build and release? Thanks for the help.

idodav profile image
Ido David

Thank you!!! saved me a lot of time

mukiblejlok profile image

Thanks for that! You saved me some hours of debugging.

michaelmasas profile image
Michael Masas

Thank You !