Container Registry | ACR

Upload image

Use Azure CLI to push an image to the container registry. You can find the ACR in the resource group: rg-<environment>-<short company name>-<workload name>-aks e.g. ' rg-prod-tls-cmaas-aks'

# Login to Azure
az login

# Login to the Azure Container Registry
az acr login --name <azure_container_registry_name>

# Local Images
# Create an alias for a local image
docker tag cmaasexampleservice:v1 <azure_container_registry_name>.azurecr.io/example/nginx:v1

# Push the image to the registry
docker push <azure_container_registry_name>.azurecr.io/example/nginx:v1

# External images
az acr import -n <acr-name> --source docker.io/library/nginx:latest --image nginx:v1

Pull image

# Login to Azure
az login

# Login to the Azure Container Registry
az acr login --name <azure_container_registry_name>

# Pull image
docker pull  <azure_container_registry_name>.azurecr.io/example/nginx:v1

Delete image

# Login to Azure
az login

# Login to the Azure Container Registry
az acr login --name <azure_container_registry_name>

# Delete image from ACR
az acr repository delete --name <azure_container_registry_name> --image example/nginx:v1