Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

python 3.x - Chromedriver Installation using Docker file but the chrome driver does not reflect in the mentioned directory

Set base image (host OS)

FROM python:3.8
RUN apt-get update && apt-get install -y 
python-pip

Installing wget command

RUN pip install wget

Copy the dependencies file to the working directory

COPY requirements.txt .

Install dependencies

RUN pip install -r requirements.txt

Trying to install the chrome driver

RUN wget -O /tmp/chromedriver.zip  https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_mac64.zip
question from:https://stackoverflow.com/questions/65861153/chromedriver-installation-using-docker-file-but-the-chrome-driver-does-not-refle

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Why are you using chrome driver for mac distribution in ubuntu container ? I am not sure of what's beneath it, but I guess there might be some issues due to os type.(Not sure)

You can try adding the ubuntu distribution as shown below, it should work.

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
    sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' 
    sudo apt-get -y update 
    sudo apt-get -y install google-chrome-stable

RUN sudo apt-get -y install chromium-chromedriver

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...