Reputation: 53
I want to deploy a image from docker hub to Azure Container Instance.How can we do this.Is it mandatory to push the image first to Azure Container Registry?
All solutions I am getting shows that we need to push the image first to Azure Container Registry.
Upvotes: 3
Views: 7537
Reputation: 31414
No, you need not push the image to ACR first, just let the image stay in the docker hub. For example, deploy the Nginx docker image to ACI, the Azure CLI command like below:
az container create -g resourceGroup -n aciName --image nginx --ports 80
As the command shows, you can use the docker image. Actually, the docker hub is the default registry. When you use another registry, you need to add the parameters --registry-login-server
, --registry-username
and --registry-password
. For more details, see az container create
.
It also shows clearly in the Azure portal, when you create ACI in the portal, you can see it like below:
Upvotes: 4
Reputation: 222582
You can use docker image directly with the container
as follows,
az container create --resource-group myResourceGroup --name mycontainer --image docker image url
Upvotes: 0