miniguide

Azure ACR Cheatsheet: Manage and Troubleshoot Azure Container Registry

Introduction

This cheatsheet is designed for DevOps personnel to quickly create, manage, and troubleshoot Azure Container Registry resources utilizing the Azure CLI.

Table of Contents

1. Create ACR

Example: Crea un nuovo registro ACR.

az acr create --name <acrName> --resource-group <rg> --sku Basic --location <location>

2. List ACRs

Example: Elenca tutti i registri ACR nel gruppo di risorse.

az acr list --resource-group <rg> --output table

3. Show ACR Details

Example: Mostra i dettagli di un registro ACR.

az acr show --name <acrName> --resource-group <rg>

4. Update ACR

Example: Aggiorna le impostazioni (ad esempio, abilitare il contenitore admin).

az acr update --name <acrName> --admin-enabled true

5. Delete ACR

Example: Elimina un registro ACR.

az acr delete --name <acrName> --resource-group <rg>

6. Login to ACR

Example: Effettua il login al registro ACR per autenticarsi con Docker.

az acr login --name <acrName>

7. Build Container Image

Example: Costruisci un’immagine container e salvala nel registro ACR.

az acr build --registry <acrName> --image <imageName>:<tag> .

8. Run Task in ACR

Example: Esegue un task per analisi o scansione dell’immagine.

az acr run --registry <acrName> --cmd "echo Hello World" /dev/null

9. Import Image to ACR

Example: Importa un’immagine da un registro esterno.

az acr import --name <acrName> --source <externalRegistry>/<repository>:<tag>

10. Repository Manifests

Example: Visualizza i manifesti del repository di un’immagine.

az acr repository show-manifests --name <acrName> --repository <repositoryName>