Janne Mattila

From programmer to programmer -- Programming just for the fun of it

Anonymous access to my images from Azure Container Registry

Posted on: December 31, 2030

If I want to deploy Azure Container Instances (ACI) with my images from Docker Hub, I’m quite frequently running into these deployment errors:

resource_group_name="rg-aci-demo"
location="swedencentral"

az group create -l $location -n $resource_group_name -o table

aci_ip=$(az container create \
  --name "aci-demo" \
  --resource-group $resource_group_name \
  --image "jannemattila/webapp-network-tester:1.0.76" \
  --ports 80 \
  --ip-address Public \
  --cpu 1 \
  --memory 1 \
  --environment-variables "ASPNETCORE_URLS=http://*:80" \
  --restart-policy Always \
  --query ipAddress.ip -o tsv)

curl $aci_ip
az acr update --name "jannemattila" --anonymous-pull-enabled true