Thursday, March 4, 2021

How to upload Docker images to Azure Container Registry | Hosting Docker images in Azure Container Registry

Azure Container Registry is a managed, private docker registry service. You can create and maintain Azure container registries to store and manage your private Docker container images.

It is alternative to Docker Hub. Azure Container Registry allows you to build, store, and manage container images and artifacts in a private registry for all types of container deployments.

Let us see how to upload a docker images from your VM into ACR.

Watch the steps below in YouTube channel:


Pre-requistes:
Make sure you have docker installed on your VM.
 
Step 1 - Create Azure Container Registry (ACR)

Go to https://portal.azure.com/
Create a Resource, Give container registry as a name

Click on Create

  
Enter values as mentioned below:
Give registry name, resource group and choose Enable admin user and SKU as Basic 



 Click on Review and then create, now your container registry is been created.

Step 2 - Download sample Python App

Go to your machine where you have docker images stored. perform below command to download sample pythonapp which is already dockerized.
 
git clone https://bitbucket.org/ananthkannan/mydockerrepo/src/master/pythonApp/ 

cd  pythonApp/pythonApp

Step 3 - Create docker image

docker build . -t mypythonapp

type below command:
sudo docker images

this should show docker images you have created locally.

Now go to ACR, click on docker registry you created. Click on access keys under Settings.


Copy value under login server 
Login to Azure Container Registry through command line.
sudo docker login mydockerazureregistry.azurecr.io
Username: mydockerazureregistry

Enter password by copying value below password


Step 4 - Tag and Push your docker image to ACR
Now tag the docker image per as below:
sudo docker tag mypythonapp mydockerazureregistry.azurecr.io/mypythonapp

sudo docker push mydockerazureregistry.azurecr.io/mypythonapp

That's it..Docker image is pushed into ACR. 
You can see the Docker image uploaded under Services--> repositories


5 comments:

  1. Thanks for extremely good and valuable share.

    ReplyDelete
  2. Hi,

    How to login to docker registry with IAM ?

    Thanks,
    Yogesh.

    ReplyDelete
  3. A portion of the more modest facilitating suppliers can befuddle you to accept that each new space needs another facilitating account. https://onohosting.com/

    ReplyDelete
  4. Hi Sir,when ever i am building and push into ACR i want to create a latest tag ,how is that possible.plzz help me.

    ReplyDelete

AWS, Azure Cloud and DevOps Coaching Online Classes | Dec 2021 Schedule

Are you in IT? Tired of your work? Are you not able to make any good progress in your career?  Are you not having a job? Looking for a b...