Skip to content

Commit

Permalink
Install chrome-for-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Feb 20, 2024
1 parent 60235c0 commit 6789b13
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions chrome-latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM ghcr.io/day8/core:latest

RUN \
export CHROME_VERSION="107.0.5304.110-1" && \
export CHROME_SHA256SUM="52e6d1be974c36cb40469f03b128cf21b36359a05fdadbb2e0379fbb17ef341b" && \
export CHROMEDRIVER_VERSION="107.0.5304.62" && \
export CHROME_FOR_TESTING_VERSION="121.0.6167.184" && \
export CHROME_FOR_TESTING_URL="https://storage.googleapis.com/chrome-for-testing-public/${CHROME_FOR_TESTING_VERSION}/linux64/chrome-linux64.zip" && \
export CHROME_FOR_TESTING_FILENAME=$(basename "${CHROME_FOR_TESTING_URL%%\?*}") && \
export CHROMEDRIVER_URL="https://storage.googleapis.com/chrome-for-testing-public/${CHROME_FOR_TESTING_VERSION}/linux64/chromedriver-linux64.zip" && \
export CHROMEDRIVER_FILENAME=$(basename "${CHROMEDRIVER_URL%%\?*}") && \
export CHROME_FOR_TESTING_SHA256SUM="" && \
export CHROMEDRIVER_SHA256SUM="502f124092160cbfde42705cb24aad8b48b4b5c6c22b440a34d83034019d408f" && \
#
cd /tmp && \
Expand All @@ -22,12 +25,17 @@ RUN \
#
rm -rf /var/lib/apt/lists/* && \
#
wget -q "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
wget -q $CHROME_FOR_TESTING_URL && \
echo "Verifying ChromeDriver package checksum..." && \
sha256sum "google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
echo "$CHROME_SHA256SUM *google-chrome-stable_${CHROME_VERSION}_amd64.deb" | sha256sum -c - && \
dpkg -i "google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
rm -f "google-chrome-stable_${CHROME_VERSION}_amd64.deb" && \
sha256sum $CHROME_FOR_TESTING_FILENAME && \
echo "$CHROME_FOR_TESTING_SHA256SUM $CHROME_FOR_TESTING_FILENAME" | sha256sum -c - && \
unzip -q $CHROME_FOR_TESTING_FILENAME && \
mkdir -p /opt/chrome-for-testing && \
mv ${CHROME_FOR_TESTING_FILENAME%.*} /opt/chrome-for-testing/$CHROME_FOR_TESTING_VERSION && \
ln -s /opt/chrome-for-testing/$CHROME_FOR_TESTING_VERSION /opt/chrome-for-testing/latest && \
ln -s /opt/chrome-for-testing/latest/chrome-wrapper /usr/local/bin/chrome-wrapper && \

rm -f $CHROME_FOR_TESTING_FILENAME && \
#
# Install ChromeDriver
#
Expand All @@ -38,14 +46,14 @@ RUN \
# For older versions of Chrome (e.g. '56.x') look through https://chromedriver.storage.googleapis.com/index.html
# and find the newest release with a 'notes.txt' file that mentions the major version e.g. 'Supports Chrome v56-58'.
echo "Installing ChromeDriver ${CHROMEDRIVER_VERSION}..." && \
wget -q https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip && \
wget -q $CHROMEDRIVER_URL && \
echo "Verifying ChromeDriver package checksum..." && \
sha256sum chromedriver_linux64.zip && \
echo "$CHROMEDRIVER_SHA256SUM *chromedriver_linux64.zip" | sha256sum -c - && \
unzip -q chromedriver_linux64.zip && \
rm -f chromedriver_linux64.zip && \
mv chromedriver /usr/local/bin/chromedriver && \
sha256sum $CHROMEDRIVER_FILENAME && \
echo "$CHROMEDRIVER_SHA256SUM *$CHROMEDRIVER_FILENAME" | sha256sum -c - && \
unzip -q $CHROMEDRIVER_FILENAME && \
rm -f $CHROMEDRIVER_FILENAME && \
mv ${CHROMEDRIVER_FILENAME%.*}/chromedriver /usr/local/bin/chromedriver && \
chmod +x /usr/local/bin/chromedriver && \
/opt/google/chrome/chrome --version && \
chrome-wrapper --version && \
chromedriver --version && \
echo '\n\n'

0 comments on commit 6789b13

Please sign in to comment.