Skip to content

Commit 2a1762e

Browse files
committed
Install correct version of chromedriver
1 parent 8118730 commit 2a1762e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,8 @@ RUN wget https://ftp.samba.org/pub/cwrap/nss_wrapper-1.1.2.tar.gz && \
131131
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
132132
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
133133
RUN apt-get update && apt-get install -yq --no-install-recommends google-chrome-stable
134-
RUN wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip \
135-
&& unzip chromedriver_linux64.zip \
136-
&& mv chromedriver /usr/bin/chromedriver \
137-
&& chmod 755 /usr/bin/chromedriver \
138-
&& rm chromedriver_linux64.zip
134+
COPY notebook/chromedriver.sh /root/chromedriver.sh
135+
RUN chmod +x /root/chromedriver.sh && /root/chromedriver.sh
139136

140137
# Install R and some basic packages
141138
RUN apt-get update && apt-get install -yq --no-install-recommends \

notebook/chromedriver.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
CHROME_VERSION=`/opt/google/chrome/chrome --version | cut -d ' ' -f 3`
4+
CHROME_VERSION_MAJOR=`echo $CHROME_VERSION | cut -d '.' -f 1`
5+
6+
CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION_MAJOR}`
7+
8+
wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip \
9+
&& unzip chromedriver_linux64.zip \
10+
&& mv chromedriver /usr/bin/chromedriver \
11+
&& chmod 755 /usr/bin/chromedriver \
12+
&& rm chromedriver_linux64.zip

0 commit comments

Comments
 (0)