Table of Contents


How to push a Docker image to an Azure Container Registry

Make sure you have the Azure CLI installed first, then:

# Log into your Azure account
az login

# Then into your container registry
az acr login --name <your-registry-name>

# Create an image alias
docker tag <image-name> <your-registry-name>.azurecr.io/<path/to/dir>

# Push the image
docker push <your-registry-name>.azurecr.io/<path/to/dir>

How to deploy a Docker image from an Azure Container Registry to a Container Instance

First, make sure your container registry has an admin account enabled – you’ll need it when deploying the image. You can do this either from the Azure Portal: [Container registry]/Access Keys/Admin user -> Enabled, or by running the command below:

az acr update -n <your-registry-name> --admin-enabled true

Once you’ve enabled the admin account, you can run the following command:

az container create --resource-group <your-resource-group> \
--name <your-container-name> \
--image <your-registry-name>.azurecr.io/<path/to/dir> \
--ip-address Public 
--ports <your-port>

Note that once created, you won’t be able to update all properties. To change some of the properties, you’ll need to first delete then redeploy the image.

– via Microsoft Docs