Deploy a docker image to Azure Container Instance

Akthem Rehab 31 Reputation points

I am having two docker images, one of them is an R Plumber API and the other is an R Shiny App. I follow the instructions in:

Pushing the docker images from my local docker to an Azure Container Registry works fine. However, using Azure Container Instance to run the image generates the instance but the FDQN and IP address (port included) of the instances are unreachable.

I use the following command as per the learn link above: az container create --resource-group mygroup --name myinstance --image --dns-name-label mydnsname --registry-username <username> --registry-password <password>

When I try to deploy the image as a web app on the other hand, it works just fine!

Could you please help me deploy my images as ACI ?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
672 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,393 questions
0 comments No comments
{count} vote

Accepted answer
  1. Ryan Hill 27,031 Reputation points Microsoft Employee

    @Akthem Rehab , I went through the lab as well, using wordpress:latest as the container instance and didn't have any issues. Assuming the az container create completed successfully, check to make sure container instance actually deployed successfully. Did you use the correct password for the registry i.e. az acr credentials show --name myregistry? Is it in a running state? Check for any errors in the log tab of the Containers blade that may have prevented the container from starting up and receiving traffic.


    EDIT 2022 November 14 I used rocker/rstudio image which exposes port 8787 just as your docker image does. I configured the container instance with the following CLI command az container create --name qna1085919 --image --dns-name-label qna1085919 --registry-username <registry name> --registry-password <password> --environment-variables PASSWORD=demopass@1224 --ports 8787. I was then able to navigate to the instance via the 8787 port Your setting port 443 which your app is not accepting traffic on. You should be able to adjust your docker image through the EXPOSE command i.e 8787:80 so that HTTP traffic gets forwarded to that open port. Another option is configure your docker image so that your rocker/r-base is configured to accept traffic on port 80/443.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful