dockerazure-container-instancesazure-container-registry

Azure Container Instance does not respond with dns name on browser


I have docker image which locally listens port 5000. I have deployed images to Azure Container Registry.

I have then created Azure Container Instance with:

az container create --resource-group myResourceGroup --name aci-tutorial-app --image <acrLoginServer>/aci-tutorial-app:v1 --cpu 1 --memory 1 --registry-login-server <acrLoginServer> --registry-username <service-principal-ID> --registry-password <service-principal-password> --dns-name-label <aciDnsLabel> --ports 80

Container was succesfully created, but browser does not respond with DNS name. Logs look like following.

PS C:\azure\ACIPythonAPI> az container logs --resource-group My-Container-RG --name mycontainer
[2022-01-10 08:33:36 +0000] [18] [INFO] Starting gunicorn 20.1.0
[2022-01-10 08:33:36 +0000] [18] [INFO] Listening at: http://0.0.0.0:5000 (18)
[2022-01-10 08:33:37 +0000] [18] [INFO] Using worker: sync
[2022-01-10 08:33:37 +0000] [25] [INFO] Booting worker with pid: 25

What could be problem? Port definitions are incorrect in docker? How to troubleshoot?


Solution

  • I tested in my environment, and it is working fine for me. I am using nginx images and pushed to container registry.

    enter image description here

    enter image description here

    Created container instance using image from container registry which recently pushed.I am using the same command which you have used to create container.

    enter image description here

    Would suggest you use FDQN or Public IPAddress of container instance to hit on browser and able to see response from container instance.

    enter image description here