问题描述
我正在使用Azure容器实例组..我的一个容器一直在重新启动..它进入终止状态并重新启动.一切在日志中看起来都不错.容器正在运行spring框架+ React应用程序.当我在本地运行容器时.
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?
推荐答案
您可以使用Azure CLI将重启策略设置为 OnFailure 或从不.
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
如果您指定了重新启动策略,但问题仍然存在,则您的容器中执行的应用程序或脚本可能存在一些问题.您可以使用 az container show
命令检查 restartCount
属性.
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.
这篇关于Azure容器组实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!