Setting up Azure Container Registry (ACR) to any project or deployment in stream lined - kondareddypp/azure-network-fundamentals GitHub Wiki

Setting up Azure Container Registry (ACR) is straightforward and allows you to manage container images efficiently. Here's a step-by-step guide:


1. Create a Container Registry

  1. Sign in to Azure Portal:
  2. Create a Resource:
    • Select Create a resource > Containers > Container Registry.
  3. Fill in the Basics:
    • Choose a Resource Group or create a new one.
    • Enter a unique Registry Name (5-50 alphanumeric characters).
    • Select a SKU (Basic, Standard, or Premium) based on your needs.
  4. Review and Create:
    • Click Review + Create and then Create to deploy the registry.

2. Log in to the Registry

  1. Using Azure CLI:
    • Install the Azure CLI.
    • Log in to Azure:
      az login
    • Log in to the registry:
      az acr login --name <registry-name>
  2. Using Docker:
    • Ensure Docker is installed and running.
    • Log in with Docker:
      docker login <registry-name>.azurecr.io

3. Push Images to the Registry

  1. Tag the Image:
    • Tag your Docker image with the registry's login server:
      docker tag <image-name> <registry-name>.azurecr.io/<image-name>:<tag>
  2. Push the Image:
    • Push the tagged image to ACR:
      docker push <registry-name>.azurecr.io/<image-name>:<tag>

4. Pull Images from the Registry

  1. Pull the Image:
    • Use Docker to pull the image:
      docker pull <registry-name>.azurecr.io/<image-name>:<tag>

5. Use ACR with Azure Kubernetes Service (AKS)

  1. Grant AKS Access to ACR:
    • Link your AKS cluster to ACR:
      az aks update -n <aks-cluster-name> -g <resource-group> --attach-acr <registry-name>
  2. Deploy Images to AKS:
    • Use Kubernetes manifests to deploy images from ACR.

Let me know if you'd like help with any specific step or further details!

⚠️ **GitHub.com Fallback** ⚠️