使用 WSL2 的 Docker 桌面上的容器 运行 没有实时输出

No live output from containers running on Docker Desktop with WSL2

我正在 docker 容器(django、celery、postgres、redist...等)中开发一个 python-django 应用程序 运行ning。它 运行 在 Windows 10 上使用 WSL2-Debian 和 Docker 桌面。

在我的工作期间,我需要观察所有这些容器的控制台,这样我就可以监控应用程序的行为,比如当你 运行 docker-compose up 这样你就可以让所有这些容器都处于活动状态。

当您在窗口化 Docker 桌面应用程序中单击容器时,您可以看到容器的控制台输出,但不是实际输出 - 看起来它可以工作到某个时间点并且控制台没有更新输出。 我记得它是在两三个 Docker 桌面更新之前实时工作的,我确信它是实时的,但不是现在。

是我更改了设置还是 Docker 桌面有问题?

PS。当我使用 docker-compose up(没有 -d)启动我的容器时,我可以在我的 shell 控制台上观察实时日志,但不再在 Docker 桌面上观察。

任何帮助如何恢复 Docker 桌面实时控制台视图?

这是 Docker Desktop v3.3.3

中的错误

GitHub 问题:https://github.com/docker/for-win/issues/11251 正如@Drarig29

所指出的

Docker Desktop 3.4 (released June 9th, yesterday) is supposed to have resolved docker/for-win issue 11251.

升级后我没有看到错误(使用普通 docker-compose,不是测试版 docker-compose v2)。

但是,正如 the OP twk and in issue 11251 评论的那样:

the live log is somehow broken - extra newline is added after every new line, but historical log entries (Eg. when you switch to/from another container) are displayed without newlines between entries (which is OK).


Update June 29th from Mathieu Champlon

Sorry it took a while but we now have an internal build that should fix it, if you wanted to give it a try:
win/stable/amd64/66242/Docker Desktop Installer.exe


2021 年 8 月更新:Issue 11251 just closed 包含:

Docker Desktop 3.6.0 has been released containing a fix for this issue.