Skip to content

Commit 35d1c75

Browse files
committed
Update to use latest chromedriver version
1 parent cd3e8fc commit 35d1c75

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

NodeChrome/Dockerfile.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
2121

2222
USER seluser
2323

24-
#==================
24+
#============================================
2525
# Chrome webdriver
26-
#==================
27-
ARG CHROME_DRIVER_VERSION=2.31
28-
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
26+
#============================================
27+
# can specify versions by CHROME_DRIVER_VERSION
28+
# Latest released version will be used by default
29+
#============================================
30+
ARG CHROME_DRIVER_VERSION="latest"
31+
RUN CD_VERSION=$(if [ ${CHROME_DRIVER_VERSION:-latest} = "latest" ]; then echo $(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE); else echo $CHROME_DRIVER_VERSION; fi) \
32+
&& echo "Using chromedriver version: "$CD_VERSION \
33+
&& wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CD_VERSION/chromedriver_linux64.zip \
2934
&& rm -rf /opt/selenium/chromedriver \
3035
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
3136
&& rm /tmp/chromedriver_linux64.zip \
32-
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
33-
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
34-
&& sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
37+
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CD_VERSION\
38+
&& chmod 755 /opt/selenium/chromedriver-$CD_VERSION\
39+
&& sudo ln -fs /opt/selenium/chromedriver-$CD_VERSION/usr/bin/chromedriver
3540

3641
COPY generate_config /opt/bin/generate_config
3742

0 commit comments

Comments
 (0)