Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu Docker图像错误:无法连接到任何X显示器_Docker_Virtualbox_Ubuntu 18.04_Docker Image - Fatal编程技术网

Ubuntu Docker图像错误:无法连接到任何X显示器

Ubuntu Docker图像错误:无法连接到任何X显示器,docker,virtualbox,ubuntu-18.04,docker-image,Docker,Virtualbox,Ubuntu 18.04,Docker Image,我在Ubuntu18.04(使用Windows10中的Virtualbox)终端上运行一个Docker映像。当我运行Docker映像卷测试时,我得到以下错误 sreeraj@sreeraj-VirtualBox:~$ sudo docker run volume-test QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' qt.qpa.screen: QXcbConnection: Could

我在Ubuntu18.04(使用Windows10中的Virtualbox)终端上运行一个Docker映像。当我运行Docker映像卷测试时,我得到以下错误

sreeraj@sreeraj-VirtualBox:~$ sudo docker run volume-test 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.
sreeraj@sreeraj-VirtualBox:~$ 

我如何解决这个问题

这是您正在使用的名为“volume test”的特定映像的一个问题。Docker Hub上有几个同名的映像,因此不清楚您实际使用的是哪个映像。您可能应该在提取此图像的存储库条目上创建一个问题。如果您自己维护/创建图像,您应该能够解决类似的问题:

最简单的方法是直接在桌面上运行应用程序,而无需Docker。您需要几位环境变量和主机目录配置,即使这样,应用程序也无法访问主目录中的用户首选项。