前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ubuntu安装chrome及firefox

ubuntu安装chrome及firefox

作者头像
code4it
发布2018-09-17 15:22:22
2.1K0
发布2018-09-17 15:22:22
举报

本文主要讲述一下如何在dockerfile里头安装chrome及firefox。

chrome

RUN apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
  gnupg \
    --no-install-recommends

RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
RUN apt-get update
## xdg-icon-resource: No writable system icon directory found.
RUN apt-get install -y --force-yes --no-install-recommends hicolor-icon-theme
RUN apt-get install -y \
    google-chrome-stable \
    --no-install-recommends

如果无法访问dl.google.com的话,估计需要自行下载然后add进去

firefox

RUN apt-get install -y --force-yes --no-install-recommends python-software-properties software-properties-common
RUN apt-add-repository ppa:mozillateam/firefox-next
RUN apt-get update
RUN apt-get install -y --force-yes --no-install-recommends firefox xvfb
RUN apt-get install -y --force-yes --no-install-recommends x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

firefox的启动有点麻烦,需要设置XDG_RUNTIME_DIR,另外需要启动display

Xvfb :10 -ac &
export DISPLAY=:10

安装中文字体

由于默认的是英文的,没有中文字体的话,访问中文网站之类的会乱码,需要安装下中文字体

RUN apt-get install -y --force-yes --no-install-recommends \
        fonts-wqy-microhei \
        ttf-wqy-zenhei
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2017-11-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 码匠的流水账 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • chrome
  • firefox
  • 安装中文字体
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档