【发布时间】:2019-03-11 17:08:56
【问题描述】:
我想为 java 和 chromedriver 构建一个 docker 映像。这是我的 dockerfile。
FROM java:8
MAINTAINER LIU JICHUN jliu666@hotmail.com
ENV TZ Asia/Shanghai
RUN echo "deb http://mirrors.ustc.edu.cn/debian/ jessie main contrib non-free" > /etc/apt/sources.list \
&& echo "deb-src http://mirrors.ustc.edu.cn/debian/ jessie main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.ustc.edu.cn/debian/ jessie-updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb-src http://mirrors.ustc.edu.cn/debian/ jessie-updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.ustc.edu.cn/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb-src http://mirrors.ustc.edu.cn/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.ustc.edu.cn/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb-src http://mirrors.ustc.edu.cn/debian-security/ jessie/updates main contrib non-free" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y libxss1 libappindicator1 libindicator7 xvfb unzip fonts-liberation libappindicator3-1 libatk-bridge2.0-0 libgtk-3-0 lsb-release xdg-utils\
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i google-chrome*.deb \
&& apt-get install -f \
&& wget -N https://chromedriver.storage.googleapis.com/2.42/chromedriver_linux64.zip \
&& unzip chromedriver_linux64.zip \
&& chmod +x chromedriver \
&& mv -f chromedriver /usr/local/share/chromedriver \
&& ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver \
&& ln -s /usr/local/share/chromedriver /usr/bin/chromedriver \
但是当我运行 chromedriver 时,出现如下错误:
Starting ChromeDriver 2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac) on port 24557
Only local connections are allowed.
[1538823654.540][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address (99)
2018-10-06 19:00:54.747 INFO 1 --- [ null to remote] o.o.selenium.remote.ProtocolHandshake : Detected dialect: OSS
【问题讨论】:
-
它有效。但有错误。
标签: docker selenium-chromedriver debian-jessie