我正在尝试将几个基于 dotnet 的功能应用程序 (v3) 迁移到 docker 容器。为此,我们使用mcr.microsoft.com/azure-functions/dotnet中的图像作为基础
当使用 docker run 进行本地测试时,我经常遇到这样的问题:对容器的 http 调用返回错误Function host is not running并结合以下 Docker CLI 输出:
Starting OpenBSD Secure Shell server: sshd.
Hosting environment: Development
Content root path: /home/site/wwwroot
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
Run Code Online (Sandbox Code Playgroud)
这仅仅意味着函数应用程序不会加载/启动,但真正的原因仍然隐藏。我一直在尝试获取更多日志记录/诊断数据来确定根本原因,但到目前为止失败了。因此,每当这种情况发生时,我都必须开始一个令人筋疲力尽的试错测试循环。到目前为止,这些情况已经花了我几天(几周?)
问题:发生此错误时如何获取更多诊断数据?
[更新] Dockerfile:
Starting OpenBSD Secure Shell server: sshd.
Hosting environment: Development
Content root path: /home/site/wwwroot
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
Run Code Online (Sandbox Code Playgroud)