0
0
Azurecloud~10 mins

Azure Container Registry (ACR) - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Azure Container Registry (ACR)
Create ACR Instance
Push Container Image
Store Image in Registry
Pull Image from Registry
Deploy Container from Image
Update or Delete Images
End
This flow shows how you create an Azure Container Registry, push container images to it, store them, pull them for deployment, and manage images.
Execution Sample
Azure
az acr create --resource-group mygroup --name myregistry --sku Basic
az acr login --name myregistry
az acr repository list --name myregistry
az acr repository show-tags --name myregistry --repository myapp
This code creates an ACR, logs in to it, lists repositories, and shows tags for a repository.
Process Table
StepCommandActionResult
1az acr create --resource-group mygroup --name myregistry --sku BasicCreate ACR instanceACR 'myregistry' created in resource group 'mygroup' with Basic SKU
2az acr login --name myregistryAuthenticate Docker client to ACRDocker client logged in to 'myregistry'
3az acr repository list --name myregistryList repositories in ACRReturns empty list [] (no images pushed yet)
4docker build -t myregistry.azurecr.io/myapp:v1 .Build container image tagged for ACRImage 'myapp:v1' built locally
5docker push myregistry.azurecr.io/myapp:v1Push image to ACRImage 'myapp:v1' pushed to 'myregistry'
6az acr repository list --name myregistryList repositories againReturns ['myapp'] showing pushed image repository
7az acr repository show-tags --name myregistry --repository myappShow tags for 'myapp'Returns ['v1'] showing pushed image tag
8docker pull myregistry.azurecr.io/myapp:v1Pull image from ACRImage 'myapp:v1' pulled successfully
9az acr repository delete --name myregistry --image myapp:v1 --yesDelete image tagImage tag 'v1' deleted from 'myapp' repository
10az acr repository list --name myregistryList repositories after deletionReturns [] (repository empty after tag deletion)
💡 All steps complete showing full lifecycle of image creation, push, pull, and deletion in ACR
Status Tracker
VariableStartAfter Step 1After Step 5After Step 7After Step 9Final
ACR InstanceNonemyregistry createdmyregistry existsmyregistry existsmyregistry existsmyregistry exists
Repositories[][]['myapp']['myapp'][][]
Image Tags in 'myapp'[][]['v1']['v1'][][]
Key Moments - 3 Insights
Why does the repository list show empty before pushing any images?
Before pushing, no images exist in the registry, so the repository list is empty as shown in step 3 of the execution_table.
What happens if you try to pull an image before pushing it?
Pulling before pushing will fail because the image does not exist in the registry yet. This is implied by the empty repository list before step 5.
Why does deleting the only tag remove the repository from the list?
In ACR, a repository exists only if it has tags. Deleting the last tag removes the repository, as shown between steps 9 and 10.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the repository list after pushing the image?
A[]
B['v1']
C['myapp']
D['myregistry']
💡 Hint
Check step 6 in the execution_table where repositories are listed after pushing.
At which step does the image get successfully pulled from the registry?
AStep 8
BStep 5
CStep 4
DStep 10
💡 Hint
Look for the 'docker pull' command in the execution_table.
If you delete the only tag of a repository, what happens to the repository list?
ARepository is renamed
BRepository is removed from the list
CRepository remains listed
DRepository tags become empty but repository stays
💡 Hint
Refer to steps 9 and 10 in the execution_table showing repository list changes after deletion.
Concept Snapshot
Azure Container Registry (ACR) stores container images securely.
Create ACR with 'az acr create'.
Push images using Docker tagged with ACR login.
List repositories and tags with 'az acr repository list' and 'show-tags'.
Pull images for deployment.
Deleting all tags removes the repository.
Full Transcript
Azure Container Registry (ACR) is a service to store container images. First, you create an ACR instance in your Azure resource group. Then you log in to it using Azure CLI. Initially, the registry has no images, so listing repositories returns empty. You build a container image locally and tag it with your registry's login server name. Next, you push the image to ACR. After pushing, the repository appears in the list with its tags. You can pull the image from ACR to deploy containers. If you delete all tags of a repository, the repository disappears from the list. This flow shows the lifecycle of container images in ACR from creation to deletion.