如何编写dockerfile来包含firefox和chrome

时间:2018-05-02 06:25:51

标签: google-chrome selenium docker selenium-chromedriver dockerfile

我想创建一个图像,可以使用firefox和chrome运行selenium测试。基本图像是ubuntu.here是我的dockerfile:

Hibernate: 
    update
        payments 
    set
        fulfillment_status=?
2018-05-02 08:54:11 WARN  SqlExceptionHelper:129 - SQL Error: 0, SQLState: 42804
2018-05-02 08:54:11 ERROR SqlExceptionHelper:131 - ERROR: column "fulfillment_status" is of type fulfillment_status but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 40

图像可以很好地运行在forefox上,但是Chrome无法正常工作! 错误代码是:

FROM ubuntu

RUN apt-get update \
    && apt-get -y install ttf-wqy-microhei ttf-wqy-zenhei \
    && apt-get install procps -y \
    && apt-get install firefox  -y \
    && apt-get install curl -y \
    && apt-get install xvfb -y\
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/ /tmp/* /var/tmp/*


ENV DISPLAY :99
COPY xvfb-run /usr/local/bin/
RUN chmod +x /usr/local/bin/xvfb-run

ADD geckodriver /usr/local/bin/
ADD chromedriver /usr/local/bin/
RUN chmod 755 /usr/local/bin/geckodriver \
    && chmod 755 /usr/local/bin/chromedriver    
RUN apt-get update &&apt-get install wget -y \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install google-chrome-stable -y \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/ /tmp/* /var/tmp/* 

RUN apt-get update && apt-get install sudo -y \
    && adduser --disabled-password --gecos '' test \
    && adduser test sudo \
    && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/ /tmp/* /var/tmp/* 

USER test

我该怎么办?有些人可以帮助我吗?

0 个答案:

没有答案