Thursday, September 30, 2021

How to upload Docker Images into Azure Container Registry using Azure Pipelines | Automate Docker builds using Azure Pipelines | Upload Docker Image into Azure Container Registry (ACR)

We will learn how to build Docker image and upload the Docker images into Azure Container Registry(ACR) using Azure Build pipelines.

Pre-requistes:

1. ACR is setup in Azure cloud. (see below for the steps)
2. Already created Azure DevOps dashboard in 
3. Dockerfile created along with the application source code

How to Create Azure Container Registry?

First Create Resource Group

Make sure you are login to Azure portal first.

az login

Execute below command to create a resource group in Azure portal.

az group create --name myResourceGroup --location southcentralus

Run the below command to create your own private container registry using Azure Container Registry (ACR).

az acr create --resource-group myResourceGroup --name myacrrepo31 --sku Standard --location southcentralus

You can login to Azure portal to see the ACR repo.


How to create a Azure Build Pipeline

1. Login into your Azure DevOps dashboard
2. Click on Pipelines.

3. Click on New Pipeline

4. Click on use the classic editor
Enter your repo name and branch name where you have stored your source code along with Dockerfile

Click on Continue. Now choose the template by typing Docker, Select Docker container and Apply.
 

Now pipeline is created with two tasks already. Now we need to customize it.

Let's modify Build an image task. Choose azure subscription and enter Microsoft credentials and select ACR repo from the drop down


Select Push an image task and select Azure subscription and select ACR repo from the drop down


Add a task for Copying YAML file, enter the Kubernetes deployment YAML file

Add Publish artifact task


Now click Save + Queue and run to start Building the pipeline



Once the build is completed, you should be able to see the Docker images under 
Services --> Repositories


Please watch the above steps in YouTube Channel:

1 comment:

  1. Further, it's true that many points, issues, and threats come up end result of} democratization of the technique of production, and especially regarding the bodily ones. For instance, the recyclability of superior nanomaterials remains to be questioned; weapons manufacturing could turn into simpler; to not mention the implications for counterfeiting and on intellectual property. It may be maintained that in Boppy Baby Lounger contrast to the economic paradigm whose aggressive dynamics were about economies of scale, commons-based peer production 3D printing could develop economies of scope.

    ReplyDelete

AWS, Azure Cloud and DevOps Coaching Online Classes | Feb 2023 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 break...