Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Jun 12, 2024
1 parent dbef5b0 commit d25d4b9
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d25d4b9

Please sign in to comment.