与Mac的Docker GUI如何

我最近开始与docker,我面临一个问题,在设置现有docker,桌面图像,并显示在我的屏幕上。 这将成为个性化整个形象的第一步:

我遵循几个网站的指令,但最简单的是: dockerfile / ubuntu-desktop

  • 下载图像没有问题
  • 当我运行它我得到以下输出:

    $ docker run -it --rm -p 5901:5901 -e USER=root dockerfile/ubuntu-desktop bash -c "vncserver :1 -geometry 1280x800 -depth 24 && tail -F /root/.vnc/*.log" You will require a password to access your desktops. Password: Verify: Would you like to enter a view-only password (y/n)? n New 'X' desktop is 0792f104dfd0:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/0792f104dfd0:1.log 03/02/15 14:10:08 Copyright (C) 2000-2007 TightVNC Group 03/02/15 14:10:08 Copyright (C) 1999 AT&T Laboratories Cambridge 03/02/15 14:10:08 All Rights Reserved. 03/02/15 14:10:08 See http://www.tightvnc.com/ for information on TightVNC 03/02/15 14:10:08 Desktop name 'X' (0792f104dfd0:1) 03/02/15 14:10:08 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t 03/02/15 14:10:08 Listening for VNC connections on TCP port 5901 Font directory '/usr/share/fonts/X11/Type1/' not found - ignoring Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring xrdb: No such file or directory xrdb: can't open file '/root/.Xresources' AUDIT: Tue Feb 3 14:10:09 2015: 17 Xtightvnc: client 6 rejected from local host 

集装箱检查输出如下:

  $ docker inspect -f '{{json .NetworkSettings }}' 0792f104dfd0 {"Bridge":"docker0","Gateway":"172.17.42.1", "IPAddress":"172.17.0.21","IPPrefixLen":16, "MacAddress":"02:42:ac:11:00:15", "PortMapping":null, "Ports":{"5901/tcp":[{"HostIp":"0.0.0.0","HostPort":"5901"}]}} 

当我尝试与VCN连接时,出现错误。

你能帮我find我应该改变,使用Docker在Mac上运行,可见的桌面?

如果你只是错过.Xresources文件尝试添加一个空的文件。 这个讨论似乎意味着它不是真的需要。 您可以使用以下方法添加文件:

 docker run -it --rm -p 5901:5901 -e USER=root dockerfile/ubuntu-desktop \ bash -c "touch /root/.Xresources && \ vncserver :1 -geometry 1280x800 -depth 24 && \ tail -F /root/.vnc/*.log" 

OSX上的Docker(以及任何非Linux操作系统)在boot2docker虚拟机内运行,并且该虚拟机的networking在虚拟机外的本地主机上不可用。 要访问networking接口,请使用可以使用boot2docker ip命令检索的boot2docker ip 。 这个IP通常是192.168.59.103,虽然不能保证。