我有一个带有 GUI 应用程序的图像,带有 microsoft/windowsservercore 的基本图像。图像中的应用程序已正确安装,但我无法在主机上显示它。在谷歌上阅读了几篇关于此的文章,他们建议安装 XServer for Windows,然后我们可以在主机上显示应用程序。我一直在尝试运行以下命令(如大多数文章中所建议的那样),但是它什么也没做,而且我没有得到显示。请协助。
docker run --rm -it -e DISPLAY=127.0.0.1:0.0 eft
最佳答案
DISPLAY
对 Linux 容器很有用。
作为mentioned here :
WindwosServerCore image does not come with binaries for UI applications so I doubt this will ever work in servercore image but Microsoft insiders can use new bigger WindwosServer image which I beleive have those libraries intact.
这thread adds :
I understand that you can run GUI apps but the rendered elements are not shown on any desktop. Lars Iwer [MSFT] writes in the discussion below the article:
In the container image as it is right now, GUI elements will be rendered in session 0. UI automation should work with that (e.g. programmatically searching for a window etc.).
session 0 是运行所有系统服务的 session ,根据定义是非交互式的。 session 、工作站和桌面是 Windows (NT) 中的隔离手段,应用程序能否显示 UI 并接收用户交互取决于它是否有权访问带有桌面的工作站。
Session 0 中的进程默认没有。
但是以前可以“允许服务与桌面交互”,也可以在 session 0 以外的其他 session 中运行交互式服务(注意“现在是这样”)。因此,很高兴听到 Microsoft/Docker 团队对此的一些专家见解......
关于docker - 无法从 Windows 容器显示 GUI 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56179570/