Part 2 : Creating azure container registry and uploading a docker image

Goal :

Welcome to Part 2 of this series blog post, In this one we are going to demonstrate how to create an azure container registry and push the docker image to it that we built in Part 1 : Running nodejs app (welcomeapp) on Docker Containers

Assumptions :

  • Familiar with Azure
  • Containers
  • Az Cli

Pre-requisties :

Follow the steps…

Login and select azure subscription


az login

# if you have multiple account use az set account


az account set --subscription <subscriptionid>

Create an azure resource group under with acr will be created


az group create --name welcomeappacr-rg --location westeurope

Create the azure container registry


az acr create --resource-group welcomeappacr-rg --name welcomeappacr --sku Basic

Obtain the azure container registry login name


az acr list --resource-group welcomeappacr-rg --query "[].{acrLoginServer:loginServer}" --output table

Login to the azure container registry


az acr login --name welcomeappacr

Prepare docker image to upload to acr


docker tag mani0070/welcomeapp welcomeappacr.azurecr.io/welcomeapp:v1

Push the docker image to acr


docker push welcomeappacr.azurecr.io/welcomeapp:v1

Verify the uploads


az acr repository list --name welcomeappacr --output table

Result
----------
welcomeapp

lets list the tags


az acr repository show-tags --name welcomeappacr --repository welcomeapp --output table

Result
--------
v1

Now we have successfully have the image in the azure container registry.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.