Pushing the Docker image from ACR to ACI

In this part of the demonstration, we are going to use the Azure CLI to deploy and push the Docker image from the ACR to an Azure Container image. To do so, follow these steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com/.
  2. Open Azure Cloud Shell.
  3. First, we need to create a new resource group:
az group create 
--name PacktACIResourceGroup
--location eastus
  1. Run the following command to create a Windows ACI and push the Docker image from ACR. The --image method should look similar to {your acr name}.azurecr.io/packtaciapp:{Image Tag} (this method is case sensitive. This will result in the following code:
az container create 
--name packtaciapp
--resource-group PacktACIResourceGroup
--os-type linux
--image packtaciapp20190917053041.azurecr.io/packtaciapp:latest
--ip-address public
  1. When executing the preceding code, you will be prompted to provide a username and password. Here, paste in the username and password that you copied from the Container Registry settings in the previous section.
  2. To display the status of the container, add the following line of code:
az container show 
--resource-group PacktACIResourceGroup
--name packtaciapp
--query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}"
--out table
  1. Once the ACI has been deployed, navigate to it in the Azure portal. From the overview blade, copy the IP address:

Deployed ACI
  1. Paste the IP address into a browser. The application will be displayed:

An app running in ACI

In this section, we pushed the Docker image from the ACR to an Azure container image. This concludes this demo. In the next section, we are going to look at AKS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.156.202