DEV Community

Sean Killeen
Sean Killeen

Posted on • Originally published at seankilleen.com on

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

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.

Problem

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.

Solution

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!

Top comments (4)

Collapse
 
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.

Collapse
 
idodav profile image
Ido David

Thank you!!! saved me a lot of time

Collapse
 
mukiblejlok profile image
FMu

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

Collapse
 
michaelmasas profile image
Michael Masas

Thank You !