You are a developer managing container images in Azure. You need to copy a container image named application:v1 from a development Azure Container Registry named devreg to a production Azure Container Registry named prodreg. Both registries are in the same Azure subscription. To save network bandwidth and time, you want to perform this copy directly from registry to registry, without downloading the image to your local workspace or requiring a local Docker installation. Which Azure CLI command should you run?
- Adocker pull devreg.azurecr.io/application:v1 followed by tagging and pushing the image to prodreg.azurecr.io
- Baz acr build --registry prodreg --image application:v1 https://devreg.azurecr.io/application:v1
- az acr import --name prodreg --source devreg.azurecr.io/application:v1 --image application:v1Answer
- DEnable a system-assigned managed identity on devreg and grant it push access to prodreg, then run az acr login --name prodreg --identity
Answer
Run the command: az acr import --name prodreg --source devreg.azurecr.io/application:v1 --image application:v1
The correct command is the one starting with 'az acr import', as it enables registry-to-registry import directly in the cloud without downloading the image or requiring a local Docker installation.
Step-by-Step Solution
Key Concept
Direct registry-to-registry container image importing in Azure Container Registry