From d25d4b9c74bd9fb04009fd39603d31b0bc381e67 Mon Sep 17 00:00:00 2001 From: Han Date: Wed, 12 Jun 2024 23:48:24 +0100 Subject: [PATCH] . --- Dockerfile.test | 108 ++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/Dockerfile.test b/Dockerfile.test index ea7509d0..e7c8d256 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -29,60 +29,60 @@ RUN /build && \ rm -Rf /tmp/* -# RUN apt-get update --error-on=any - - -# # for chrome for tests -# RUN apt-get install -y \ -# gconf-service \ -# libappindicator1 \ -# libasound2 \ -# libatk1.0-0 \ -# libatk-bridge2.0-0 \ -# libcairo-gobject2 \ -# libdrm2 \ -# libgbm1 \ -# libgconf-2-4 \ -# libgtk-3-0 \ -# libnspr4 \ -# libnss3 \ -# libx11-xcb1 \ -# libxcb-dri3-0 \ -# libxcomposite1 \ -# libxcursor1 \ -# libxdamage1 \ -# libxfixes3 \ -# libxi6 \ -# libxinerama1 \ -# libxrandr2 \ -# libxshmfence1 \ -# libxss1 \ -# libxtst6 \ -# fonts-liberation \ -# jq - - -# # Fetch the latest version numbers and URLs for Chrome and ChromeDriver -# RUN curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json > /tmp/versions.json - -# # chrome -# RUN CHROME_URL=$(jq -r '.channels.Stable.downloads.chrome[] | select(.platform=="linux64") | .url' /tmp/versions.json) && \ -# wget -q --continue -O /tmp/chrome-linux64.zip $CHROME_URL && \ -# unzip -j -o /tmp/chrome-linux64.zip -d /opt/chrome - -# RUN chmod +x /opt/chrome/chrome - -# # chromedriver -# RUN CHROMEDRIVER_URL=$(jq -r '.channels.Stable.downloads.chromedriver[] | select(.platform=="linux64") | .url' /tmp/versions.json) && \ -# wget -q --continue -O /tmp/chromedriver-linux64.zip $CHROMEDRIVER_URL && \ -# unzip -j -o /tmp/chromedriver-linux64.zip -d /opt/chromedriver && \ -# chmod +x /opt/chromedriver/chromedriver - -# # Clean up -# RUN rm /tmp/chrome-linux64.zip /tmp/chromedriver-linux64.zip /tmp/versions.json - -# ENV PATH /opt/chrome:/opt/chromedriver:$PATH -# RUN echo 'export PATH="/opt/chrome:/opt/chromedriver:$PATH"' >> ~/.bashrc +RUN apt-get update --error-on=any + + +# for chrome for tests +RUN apt-get install -y \ + gconf-service \ + libappindicator1 \ + libasound2 \ + libatk1.0-0 \ + libatk-bridge2.0-0 \ + libcairo-gobject2 \ + libdrm2 \ + libgbm1 \ + libgconf-2-4 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libx11-xcb1 \ + libxcb-dri3-0 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxfixes3 \ + libxi6 \ + libxinerama1 \ + libxrandr2 \ + libxshmfence1 \ + libxss1 \ + libxtst6 \ + fonts-liberation \ + jq + + +# Fetch the latest version numbers and URLs for Chrome and ChromeDriver +RUN curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json > /tmp/versions.json + +# chrome +RUN CHROME_URL=$(jq -r '.channels.Stable.downloads.chrome[] | select(.platform=="linux64") | .url' /tmp/versions.json) && \ + wget -q --continue -O /tmp/chrome-linux64.zip $CHROME_URL && \ + unzip -j -o /tmp/chrome-linux64.zip -d /opt/chrome + +RUN chmod +x /opt/chrome/chrome + +# chromedriver +RUN CHROMEDRIVER_URL=$(jq -r '.channels.Stable.downloads.chromedriver[] | select(.platform=="linux64") | .url' /tmp/versions.json) && \ + wget -q --continue -O /tmp/chromedriver-linux64.zip $CHROMEDRIVER_URL && \ + unzip -j -o /tmp/chromedriver-linux64.zip -d /opt/chromedriver && \ + chmod +x /opt/chromedriver/chromedriver + +# Clean up +RUN rm /tmp/chrome-linux64.zip /tmp/chromedriver-linux64.zip /tmp/versions.json + +ENV PATH /opt/chrome:/opt/chromedriver:$PATH +RUN echo 'export PATH="/opt/chrome:/opt/chromedriver:$PATH"' >> ~/.bashrc # Check chrome & chromedriver versions RUN echo "Chrome: " && chrome --version