Azure acr Commands
Introduction
az acr
commands used for managing private registries with Azure Container Registries.
This page contains a list of commonly used az acr
commands.
Note: make sure that you login into azure and select the azure subscription before running any az acr
commands.
Azure login
Select the subscription
Connect to Container Registry
outputtroubleshoot
In case if you get following error run the docker desktop to fix the issue.
You may want to use 'az acr login -n acr1dev --expose-token' to get an access token, which does not require Docker to be installed.
2023-02-20 21:38:37.187022 An error occurred: DOCKER_COMMAND_ERROR
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.
To get the login server address
output
Import container images
$acrName = "acr1dev"
$imageName = "mcr.microsoft.com/dotnet/aspnet:6.0"
az acr import --name $acrName --source $imageName --image $imageName
or
az acr import --name "acr1dev" --source "mcr.microsoft.com/dotnet/sdk:6.0" --image "mcr.microsoft.com/dotnet/sdk:6.0"
List registries
Lists all the container registries under the current subscription.
output
show tags
show tags of a image in the acr
az acr repository show-tags --name acr1dev --repository mcr.microsoft.com/dotnet/aspnet --output table
check-health
output
Docker daemon status: available
Docker version: 'Docker version 20.10.17, build a89b842, platform linux/amd64'
Docker pull of 'mcr.microsoft.com/mcr/hello-world:latest' : OK
Azure CLI version: 2.44.1
DNS lookup to acr1dev.azurecr.io at IP 20.62.128.9 : OK
Challenge endpoint https://acr1dev.azurecr.io/v2/ : OK
Fetch refresh token for registry 'acr1dev.azurecr.io' : OK
Fetch access token for registry 'acr1dev.azurecr.io' : OK
Helm version: 3.8.2
2023-02-20 21:58:29.062713 An error occurred: NOTARY_COMMAND_ERROR
Please verify if notary is installed.
Please refer to https://aka.ms/acr/errors#notary_command_error for more information.
helm list
List all helm charts in an Azure Container Registry.