Soru

Zorluk: KolayManage Container Images in Azure Container Registry

An administrator has created an Azure Container Registry named `contosoregistry`. On your local machine, you have a Docker image named `webapp:v1` that is tagged as `contosoregistry.azurecr.io/webapp:v1`. You have successfully run `az acr login --name contosoregistry` to authenticate. Which command must you run to upload this image to your registry?

  1. docker push contosoregistry.azurecr.io/webapp:v1Cevap
  2. B
    az acr push --name contosoregistry --image webapp:v1
  3. C
    docker push contosoregistry/webapp:v1
  4. D
    az acr login --name contosoregistry --push webapp:v1

Cevap

docker push contosoregistry.azurecr.io/webapp:v1
To push an image to Azure Container Registry, you must tag the image with the registry's login server domain name (such as contosoregistry.azurecr.io) and then invoke the standard docker push command. The docker push command uses the registry domain name to locate the registry endpoint and upload the image layers.

Adım Adım Çözüm

1
Ensure the local image is tagged with the fully qualified login server address of the Azure Container Registry.
The image is named contosoregistry.azurecr.io/webapp:v1.
Docker CLI uses the host portion of the tag to route the image upload to the correct registry endpoint.
2
Execute the push command using the Docker CLI.
The image layers are uploaded and stored in the Azure Container Registry repository.
Once authenticated, the local Docker daemon handles image registry communications directly.

Anahtar Kavram

Using the Docker CLI to push container images to an authenticated Azure Container Registry
Bu soruyu puanla