You have a private Azure Container Registry named registry2026. You need to copy a public container image named redis:alpine from Docker Hub directly into your registry without pulling it to your local development machine first. Which of the following Azure CLI commands should you run?
- Aaz acr login --name registry2026 --identity
- Bdocker push registry2026.azurecr.io/redis:alpine
- az acr import --name registry2026 --source docker.io/library/redis:alpine --image redis:alpineCevap
- Daz acr repository push --name registry2026 --image redis:alpine
Cevap
Use the az acr import command specifying the registry name, the source image from Docker Hub, and the target image name.
The command starting with 'az acr import' is correct because it uses the Azure Container Registry import capability to copy an image directly from Docker Hub (docker.io) into the specified registry. This bypasses the need to install Docker locally, pull the image, authenticate, tag the image, and push it.
Adım Adım Çözüm
Anahtar Kavram
Directly importing container images from public or external registries into an Azure Container Registry using the Azure CLI.