为Ubuntu安装指定版本的chrome浏览器

6 篇文章 0 订阅
5 篇文章 0 订阅

在将基于selenium的web 自动化用例容器化时,遇到了chrome stable版本升级到76,但是基础镜像 python-3.7.3不兼容的情况。为了解决这个问题,需要为镜像安装指定版本(73)的google chrome。

修改后的DockerFile相关内容如下,

# chome
RUN apt-get install software-properties-common -y
RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
RUN apt-get update -y
RUN apt-get install -y libglib2.0-0=2.50.3-2 \
    libnss3=2:3.26.2-1.1+deb9u1  \
    libgconf-2-4=3.2.6-4+b1 \
    libfontconfig1=2.11.0-6.7+b1
RUN apt-get install python-selenium python3-selenium -y
RUN wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-browser_73.0.3683.103-0ubuntu1_amd64.deb
# 如果支持76+版本的chrome,可以直接使用以下命令安装stable版本
# RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb --fix-missing; apt-get -fy install

# chrome_driver, 注意版本对应
RUN cd /bin && wget https://chromedriver.storage.googleapis.com/76.0.3809.126/chromedriver_linux64.zip && unzip chromedriver_linux64.zip
RUN chmod +x /bin/chromedriver

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值