azure-container-instances - 在 Azure 容器实例中运行 Linux 容器时出错 : failed to open log file "/var/log/pods/.../<container name>_0.log"

标签 azure-container-instances

我正在 Linux 容器中运行 .NET Core 应用程序。

容器在本地运行良好,但在 Azure 容器实例中运行时,它立即停止。

容器的日志文件如下所示(使用 Get-AzContainerInstanceLog 检索):

failed to open log file "/var/log/pods/336d7870-5a8e-11e9-925e-000d3a0ddc4a/test-1_0.log": 
open /var/log/pods/336d7870-5a8e-11e9-925e-000d3a0ddc4a/test-1_0.log: no such file or directory

编辑:

我之前从未遇到过上述文件或 pods 路径 (/var/log/pods/336d7870-5a8e-11e9-925e-000d3a0ddc4a/test-1_0.log ),而且我不知道操作系统和/或 Docker 的哪一部分需要它。

日志文件和路径不是我在容器内运行的应用程序使用的内容(它直接记录到控制台,并且如上所述,在我的本地 Docker for Windows 安装上的 Linux 容器中运行良好)。

Google 表示这可能与 Kubernetes 有关,但我并没有“主动”使用 Kubernetes(即它可能被 Azure 容器实例在幕后使用,但这不是我作为 ACI 用户所知道的)。 抱歉,错误描述不清楚,我会尝试重新表述。

最佳答案

问题是我试图将命令行参数传递给容器,但这在 Azure 中不起作用。

我从使用命令行参数切换到环境变量,一切都像魔术一样工作。

所以对我来说,这个错误是在容器启动失败时发生的。

提供了更好的错误描述,隐藏在 Azure 门户中的一个选项卡/ Blade 中一目了然。

关于azure-container-instances - 在 Azure 容器实例中运行 Linux 容器时出错 : failed to open log file "/var/log/pods/.../<container name>_0.log",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55586319/

相关文章:

使用命令行参数启动时 Azure ACI 容器部署失败

azure - 通过 ARM 使用 Azure 容器实例创建不确定数量的容器

azure - 如何在本地和 azure 中使用相同的 compose.yml 文件?

azure-container-instances - 是否有在 Azure 容器实例上启用 SSL 的内置支持?

azure - 如何在 azure 容器创建中传递容器级别参数

azure - Kubernetes 虚拟节点池虚拟机意外费用

python - Azure 容器实例 Python API - 无法从 Azure 容器注册表获取图像

azure - 在 Azure 上的私有(private)容器镜像实例中,镜像注册表的密码和用户名如何以及在何处存储?

azure - 在 Azure 容器实例上运行 Superset

Azure 容器 - 与远程容器实例上的文件交互