图像化界面 显示firefox浏览器
2017-10-16 19:21
323 查看
Dockerfile文件
#!/bin/bash FROM centos:7 RUN yum install -y firefox ####用你自己的 uid /gid 替换下面的0 RUN export uid=0 gid=0 RUN mkdir -p /home/developer RUN echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash">>/etc/passwd RUN echo "developer:x:${uid}:">>/etc/group RUN echo "developer ALL=(ALL) NOPASSWD: ALL">>/etc/sudoers RUN chmod 0440 /etc/sudoers RUN chown ${uid}:${gid} -R /home/developer USER developer ENV HOME /home/developer CMD /usr/bin/firefox
注意:在第四行的配置中,用你自己的用户和组id来替换0。 我们可以用下面的命令在shell或者终端中得到uid和gid。
# id $USER
构造Docker容器
# docker build --rm -t firefox .
运行Docker容器
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix firefox
The next I tried to run the same container with -u 0 to become root and after i tried to start the application the following error message appears:
No protocol specified QXcbConnection: Could not connect to display :0 Aborted (core dumped)
The Solution of the problem:
Give docker the rights to access the X-Server with:
#xhost +local:docker
相关文章推荐
- 在Linux下Firefox浏览器显示乱码的情况处理
- firefox默认浏览器配置 英文版eclipse配置中文显示
- IE,FireFox浏览器当选中图片就显示的兼容问题
- 关闭子页面刷新父页面时候,Firefox 必须发送将会导致重复之前动作的数据(例如搜索或者下订单)。 ie提示:若要再次显示该页面,web浏览器需要重新发送您以前提交的信息
- 直接拨号、将电话号码传入拨号程序、调用拨号程序、调用系统浏览器浏览网页、调用系统程序查看联系人、显示系统设置界面和显示Wi-Fi设置界面代码
- chorme和FireFox浏览器不显示按钮的问题
- 上传文件框在firefox浏览器中显示路径不全的解决方法
- IE显示div正常,Firefox浏览器中div层重叠的解决方法
- ubuntu11.10中的firefox浏览器无法显示download进度(download窗口空白)
- Firefox浏览器自带"阻止此页面创建其它对话框"设置为不显示
- 文本框显示行号功能-支持IE/firefox/chrome等浏览器
- 随笔日记:firefox界面有的gif图像不显示
- JS实时显示当前时间(IE+firefox)浏览器兼容代码(图证)
- 设置Firefox(火狐)浏览器的中文菜单/界面
- ubuntu linux中firefox浏览器flash中文显示为方框的问题
- 将鼠标放在A标签上时浏览器左下角会显示跳转后界面地址,如何隐藏
- JS实时显示当前时间(IE+firefox)浏览器兼容代码(图证)
- Firefox浏览器实现书签栏只在空白页显示
- jstree在chrome浏览器中显示的排序与其他浏览器(firefox,IE)显示不一致
- 在myeclipse中的jsp里引入html,浏览器界面显示乱码的解决办法