Skip to content

Commit edf88e5

Browse files
authored
Merge pull request #71 from linuxserver/70-bug-wrong-chrome-driver-version
Download the same chromedriver version as the installed chrome version.
2 parents c7620ea + 1b4d481 commit edf88e5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ RUN \
3030
xserver-xephyr \
3131
xvfb && \
3232
echo "**** install chrome driver ****" && \
33-
CHROME_RELEASE=$(curl -sLk https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE) && \
34-
echo "Retrieving Chrome driver version ${CHROME_RELEASE}" && \
33+
CHROME_VERSION=$(google-chrome --version | awk '{print $3}') && \
34+
CHROME_MAJOR=${CHROME_VERSION%%.*} && \
35+
CHROME_RELEASE=$(curl -fsSLk "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_MAJOR}" || true) && \
36+
if [ -z "${CHROME_RELEASE}" ]; then \
37+
CHROME_RELEASE=$(curl -fsSLk https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE); \
38+
fi && \
39+
echo "Installed Chrome ${CHROME_VERSION}; retrieving ChromeDriver ${CHROME_RELEASE}" && \
3540
curl -sk -o \
3641
/tmp/chrome.zip -L \
3742
"https://storage.googleapis.com/chrome-for-testing-public/${CHROME_RELEASE}/linux64/chromedriver-linux64.zip" && \

0 commit comments

Comments
 (0)