You might want to do quick test deploying your containers to AKS or Azure App Services, while development is ongoing. I fyou do not have a pipelines setup yet you may need to manually push your docker images to Azure Contianer Registry (ACR). Let's have a look at the steps need to push a local image built to ACR using docker commands.
For ecample, consider the following .NET api docker image built and available in a local machine.
Before we push the image to ACR we need to tag it with ACR login server name. You can copy the ACR login server name from the Azure portal, ACR overview page.docker tag invoiceapi:dev youracrloginservername/mydemo/invoiceapi:1.0
docker tag invoiceapi:dev acrdev03.azurecr.io/mydemo/invoiceapi:1.0
The following command can be used to log on to the ACR. For the user name and password you can user a service principal (spn) app id (spn id) and password (spn password), instead of ACR user name and password copied from ACR as shown above. Such service principal in Azure should be assigned with AcrPush role for the ACR.
docker login youracrloginservername -u username -p password
docker push youracrloginservername/mydemo/invoiceapi:1.0
No comments:
Post a Comment