Windows 10 Docker主机 - 从Linux容器显示GUI应用程序 [英] Windows 10 Docker Host - Display GUI application from Linux Container

查看:1246
本文介绍了Windows 10 Docker主机 - 从Linux容器显示GUI应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Windows 10作为我的主机,并运行包含基于gui的应用程序的Docker容器,并使用X11转发或类似的方式显示它们。几乎所有在网上找到的信息都涉及Linux主机到Linux容器(例如 - http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker )套接字/ x11权限的露出。我发现的其他信息来自以前的Boot2Docker / Windows实现,其中需要virtualbox作为安装过程的一部分,需要VNC。



基本设置目前有人知道需要调整什么才能使Firefox在主机系统的窗口中显示? -



在Windows 10主机上启动XMing服务器



Dockerfile



  FROM ubuntu:14.04 
RUN apt-get update&& apt-get install -y firefox
CMD / usr / bin / firefox



命令< h2>

  PS> docker build -t firefox。 
PS> set-variable-name DISPLAY -value localhost:0.0
PS>码头运行-ti --rm -e DISPLAY = $ DISPLAY firefox

谢谢

解决方案

您需要将DISPLAY设置为除 localhost 之外的其他内容。容器有自己的localhost接口,所以你的X11客户端将尝试连接到自己而不是你的主机。



相反,你可以传入你的IP地址Windows机器的网络适配器。容器将能够连接到该容器。您还需要将X11服务器配置为在该界面上侦听。


I'm trying to use Windows 10 as my host and run Docker containers that contain gui based applications and display them using X11 forwarding or something similar. Pretty much all of the information I've found online deal with Linux Host to Linux Container (example - http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker) where the socket / x11 authority are exposed. Other information I've found is from previous implementations of Boot2Docker / Windows where virtualbox was required as part of the setup procedure and required VNC.

Basic setup currently, does anyone know what has to be adjusted to get Firefox to display within a window on the host system? --

Start an XMing server on Windows 10 host

Dockerfile

FROM ubuntu:14.04
RUN apt-get update && apt-get install -y firefox
CMD /usr/bin/firefox

Commands

PS> docker build -t firefox .
PS> set-variable -name DISPLAY -value localhost:0.0
PS> docker run -ti --rm -e DISPLAY=$DISPLAY firefox

Thanks

解决方案

You'll need to set DISPLAY to something other than localhost. The container has its own localhost interface, so your X11 client will attempt to connect to itself instead of to your host.

Instead, you can pass in an IP address of your windows machine's network adapter. The container will be able to connect to that. You'll also need to have your X11 server configured to listen on that interface.

这篇关于Windows 10 Docker主机 - 从Linux容器显示GUI应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆