Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 3.24 KB

aks-102-acr.md

File metadata and controls

85 lines (65 loc) · 3.24 KB

AKS102: Azure Container Registry (ACR) and ACR Build

In this module, you will use Azure Container Registry (ACR) to build containers from Dockerfiles and also host your images to run in AKS

Create Azure Container Registry instance

ACR_NAME="myazconacr"   # Your Registry Name
az acr create --resource-group $RESOURCE_GROUP --name $ACR_NAME --sku Standard
  • Resource Group: Use the existing Resource Group that you created in previous module
  • SKU Options: Basic, Standard(default), Premium: The Standard registry offers the same capabilities as Basic, but with increased storage limits and image throughput. Standard registries should satisfy the needs of most production scenarios.

Attach ACR to AKS sp AKS can pull images from your ACR

az aks update -n $CLUSTER_NAME -g $RESOURCE_GROUP --attach-acr $ACR_NAME

Build Containers from Dockerfiles using ACR Build and host the images in ACR

Clone the workshop repo into the cloud shell environment

Clone the workshop repo

$ git clone https://github.com/griffinbird/azure-container-labs.git

Then, change directory to the repository

$ cd azure-container-labs
$ ls

apps  assets  charts  kubernetes-manifests  labs  LICENSE  README.md  scripts

Build azure-vote-front container

ACR_NAME="myazconacr"   # Registry Name
cd azure-container-labs/apps/vote/azure-vote
az acr build --registry $ACR_NAME --image azure-vote-front:1.0.0 .

Build azure-vote-msyql container

ACR_NAME="myazconacr"   # Registry Name
cd azure-container-labs/apps/vote/azure-vote-mysql
az acr build --registry $ACR_NAME --image azure-vote-back:1.0.0 .

Check your repositories in ACR

$ az acr repository list -n $ACR_NAME -o table

Result
----------------
azure-vote-front
azure-vote-back
$  az acr repository show -n $ACR_NAME --repository azure-vote-front -o table

CreatedTime                   ImageName         LastUpdateTime                ManifestCount    Registry               TagCount
----------------------------  ----------------  ----------------------------  ---------------  ---------------------  ----------
2018-09-20T02:03:33.3498203Z  azure-vote-front  2018-09-20T02:03:33.4005353Z  1                myazconacr.azurecr.io  1

Useful Links


Top | Back | Next