Update chrome url in the dockerfile (#4592)

This commit is contained in:
Gyeongjae Choi 2024-03-12 19:28:33 +09:00 committed by GitHub
parent cdd1a559a5
commit de27f18c91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 13 deletions

View File

@ -40,7 +40,7 @@ RUN pip3 --no-cache-dir install -r requirements.txt \
ARG CHROME_VERSION="latest"
ARG FIREFOX_VERSION="latest"
# Note: geckodriver version needs to be updated manually
ARG GECKODRIVER_VERSION="0.32.2"
ARG GECKODRIVER_VERSION="0.34.0"
#============================================
# Firefox & geckodriver
@ -83,26 +83,22 @@ RUN if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "nightly-latest"
#============================================
RUN if [ $CHROME_VERSION = "latest" ]; \
then CHROMEDRIVER_VERSION_FULL=$(wget --no-verbose -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"); \
else CHROMEDRIVER_VERSION_FULL=$(wget --no-verbose -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}"); \
then CHROME_VERSION_FULL=$(wget --no-verbose -O - "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE"); \
else CHROME_VERSION_FULL=$(wget --no-verbose -O - "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_VERSION}"); \
fi \
&& CHROME_VERSION_MAJOR=$(echo $CHROMEDRIVER_VERSION_FULL | cut -d '.' -f 1) \
&& CHROME_VERSION_FULL=$(wget --no-verbose -O - "https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions" | jq -r '.versions[] | .version' | grep "^${CHROME_VERSION_MAJOR}" | head -n 1) \
&& CHROME_DOWNLOAD_URL="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION_FULL}-1_amd64.deb" \
&& CHROMEDRIVER_DOWNLOAD_URL="https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION_FULL}/linux64/chromedriver-linux64.zip" \
&& wget --no-verbose -O /tmp/google-chrome.deb ${CHROME_DOWNLOAD_URL} \
&& apt-get update \
&& apt install -qqy /tmp/google-chrome.deb \
&& rm -f /tmp/google-chrome.deb \
&& rm -rf /var/lib/apt/lists/* \
&& wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION_FULL/chromedriver_linux64.zip \
&& rm -rf /opt/selenium/chromedriver \
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
&& rm /tmp/chromedriver_linux64.zip \
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROMEDRIVER_VERSION_FULL \
&& chmod 755 /opt/selenium/chromedriver-$CHROMEDRIVER_VERSION_FULL \
&& ln -fs /opt/selenium/chromedriver-$CHROMEDRIVER_VERSION_FULL /usr/local/bin/chromedriver \
&& wget --no-verbose -O /tmp/chromedriver-linux64.zip ${CHROMEDRIVER_DOWNLOAD_URL} \
&& unzip /tmp/chromedriver-linux64.zip -d /opt/ \
&& rm /tmp/chromedriver-linux64.zip \
&& ln -fs /opt/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver \
&& echo "Using Chrome version: $(google-chrome --version)" \
&& echo "Using Chromedriver version: "$CHROMEDRIVER_VERSION_FULL
&& echo "Using Chrome Driver version: $(chromedriver --version)"
COPY --from=node-image /usr/local/bin/node /usr/local/bin/
COPY --from=node-image /usr/local/lib/node_modules /usr/local/lib/node_modules