我有一个基于 QT 的 GUI 应用程序,它是在 docker(centos 镜像)中编译的。我可以在我的 Linux 机器(OpenSUSE 13.2)中从 Centos 镜像中启动 GUI 应用程序
按照此博客的说明进行操作
"http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker "
我想通过 window.I 安装 window docker 做同样的事情。我加载了具有 GUI 应用程序的所需 centos 图像,并通过终端尝试使用 container 启动 GUI。它给出错误说“gui:无法连接到 X 服务器”
任何想法或解决方案。
最佳答案
docker issue 8710上也有类似的讨论,但对于 MacOS:
A somewhat crude way to do this:
Start
socat
to expose localxquartz
socket on a TCP port
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
(注意:对于 Windows,您至少需要:socat
is available for Windows)
Pass the display to container (assuming virtualbox host is available on 192.168.59.3):
docker run -e DISPLAY=192.168.59.3:0 jess/geary
(This is insecure on public networks, add
bind
,su
andrange
options to socat to limit access.)
关于window - 如何使用 Docker 从 Window 中的 linux 容器运行 GUI 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29844237/