2

I am working with Azure Container Instance group.. and one of my containers is constantly restarting.. it goes to a terminated state and restarts. Everything looks good in logs.. The container is running a spring framework + React application. When I run the containers locally.. it works perfectly.

Am not sure what is happening behind the scenes?

Ross
  • 99
  • 2
  • 12
  • Can you please post the json file so i can have a look. I guess your missing a environmental variable for your container – Nelson Cajetin Diego Alfonso May 16 '18 at 18:32
  • +1 to showing your deployment configuration, if it works locally this means some property set for ACI isn't correct causing an exit and perpetual restart if you have the default restartPolicy of "Always". – jluk Nov 06 '18 at 19:40
  • Are you sending errors/exceptions to STDOUT? It's possible the error isn't being captured. – ryanwebjackson May 12 '19 at 14:41

1 Answers1

0

You could use Azure CLI to set a restart policy of OnFailure or Never.

az container create \
    --resource-group myResourceGroup \
    --name mycontainer \
    --image mycontainerimage \
    --restart-policy OnFailure

If you specify the restart policy and the issue still exists,there might be some problems with the application or script executed in your container. You could use az container show command to check the restartCount property.

az container show --name
                  --resource-group

For more details, refer to this article.

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
  • When I set the restart policy to **OnFailure** the container runs and then goes to a terminated state and again restarts.. this keeps going on in a loop. – Ross Mar 29 '18 at 12:42
  • and when i set the restart policy to **Never** the container gets terminated. – Ross Mar 29 '18 at 12:52
  • @Ross What the restartCount property of your container? Perhaps there is a issue with your application or script executed in the container. – Joy Wang Mar 30 '18 at 01:28
  • I have the same problem. The container is killed off as soon as it starts even if my restart policy is onfailure – johnstaveley Nov 04 '20 at 09:59