Azure Container Registry (ACR) Run vs Azure Container Instance (ACI) Create
Asked Answered
C

1

12

While studying for the AZ-204 certification, I found myself in a question related to two commands.

Azure Container Registry (ACR)

Run the sample/hello-world:v1 container image from your container registry by using the az acr run command

az acr run \
--registry <myContainerRegistry> \
--cmd '$Registry/sample/hello-world:v1' /dev/null

Azure Container Instance (ACI)

Run the following az container create command to start a container instance

az container create \
--resource-group az204-aci-rg \
--name mycontainer \
--image mcr.microsoft.com/azuredocs/aci-helloworld \
--ports 80 \
--dns-name-label $DNS_NAME_LABEL --location <myLocation> \

If both run a container, what is the difference between the two commands?

Thank you.

Cameleer answered 11/5, 2022 at 19:19 Comment(0)
C
13

My understanding here is that az acr run will just perform a quick run of the image you're added to your container registry providing some logging output.

Whereas az container create actually creates a running instance of your container or container group. So the container service will persist for as long as you expect it to run.

The container registry is more a repository for your container images rather than a place where they are run and provided as a service. The azure container instances product is where you can deploy container groups which can pull container images from your registry, you can also pull images into other azure products such as the app service and the azure kubernetes service.

Culver answered 11/5, 2022 at 19:40 Comment(1)
similar discussion on difference between ACR and ACI here: serverfault.com/questions/1083358/…Berkowitz

© 2022 - 2024 — McMap. All rights reserved.