Currently I am helping different customers in implementing containerized delivery for their .NET applications on Windows hosts. One important part of the containerized delivery infrastructure is the so-called Container Registry. There are different on-premise and cloud registry products available for storing your company owned Windows Container Images like the Nexus Repository, Artifactory for on-premise situations and the Docker Trusted Registry, Azure Container Registry, AWS Container Registry and Google Container Registry for cloud scenario’s.
Because we are creating a new cloud platform based on Microsoft Azure we also decided to make use of the Azure Container Registry for storing our Windows container images. While making the delivery pipeline work, we faced the following issue in pulling earlier pushed container images from the Azure Container Registry. A not very user friendly message..
We pushed our image with the 29 version tag successful to the Azure Container registry as shown below.
So what’s going on? I navigated to the Azure portal to see what was in my Azure Container Registry. As you can see it contains the website image with the correct 29 version as tag.
However it does not find this image when we try to get it with the latest tag. And the reason is quite simple: we did not push this website image with a latest tag to the repository. My first assumption was that the container registry would solve this for me and pull the 29 version even I didn’t pushed it to the Azure Container Registry under the latest tag. However this is not how the container registries are implemented. So to solve this issue we have to push the image to the repository with the latest tag.
We can easily make this work in our VSTS build by checking the Include Latest Tag in our build and push Docker task as shown in the image above. Once that’s implemented and we run a new build you’ll see the image been pushed successfully to the Azure Container Registry.
When we try to pull the image with the latest tag again, you’ll see we receive the image locally.