Wednesday, August 15, 2018

Push Docker Images to Azure Container Registry (ACR)

How to Push you custom Docker Images to Azure Container Registry?

In this post, We will be going to see that how we can tag and push our custom docker images to ACR i.e. Azure Container Registry. 

Azure CLI

We are going to use Azure CLI during whole setup. So make sure you have Azure CLI installed and you are able to run "az" command. You can check your CLI version using |az --version| as below-
If you don't have installed. you can download and install it from |https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest|.

Note - I am assuming here that -
  • you have already logged in with Azure CLI. If you haven't, then please do that using |az login|.
  • You have already created ACR in specific Resource Group. If not, then do that using |az group create [OPTIONS]|.

Login to Azure Container Registry-

Fetch name of ACR using command |az acr list -g {group_name} -o table|.


Then, use command |az acr login --name [Registry Name]| to log in to your  Azure Container Registry:


Tag your Docker Image-

One important thing here, if want to push docker image to registry then that should be tagged with registry name or here with loginServer name of registry. Actually these tags will be used for routing when we push these tagged images to registry.

So, lets find out the loginServer name for Azure Container Registry. Use below command for the same -

         | az acr list -g [Group Name] --query "[].{acrLoginServer:loginServer}" -o table|


Now, we'll tag the one of the available image and then will push that to azure container registry.

List of Current Images -



Tag Image with ID |7b46b9b6f72a| -



List Images again-



You can see new image tagged starting with the same name as ACR registry. Now lets push this image to ACR.

Push Image to ACR

   Check if Images have been uploaded successfully to ACR-


You can note down the highlighted one that we pushed before and it is there in ACR. Of course, You can verify this all from Azure Portal as well.

That\s all for now. Happy Learning :)!!



Integrate Jenkins with Azure Key Vault

Jenkins has been one of the most used CI/CD tools. For every tool which we are using in our daily life, it becomes really challenges when ...