容器執行環境看起來狀況不佳
.NET Aspire 需要 Docker(或 Podman)才能運作良好。 本主題描述你可能看到的 Docker 狀況不良的可能徵兆。
癥狀
啟動 AppHost 時,儀錶板不會顯示,且類似此範例的例外狀況堆疊追蹤會顯示在控制台中:
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 8.1.0-dev
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: D:\aspire\playground\PostgresEndToEnd\PostgresEndToEnd.AppHost
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
Aspire.Hosting.DistributedApplicationException: Container runtime 'docker' was found but appears to be unhealthy. The error from the container runtime check was error during connect: this error may indicate that the docker daemon is not running: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.45/containers/json?limit=1": open //./pipe/docker_engine: The system cannot find the file specified..
可能的解決方案
確認已安裝並執行 Docker:
- 在 Windows 上,檢查系統匣中是否有 Docker 圖示,並標示為「執行中」。
- 在 Linux上,檢查
docker ps -a
是否傳回成功。