Created
January 17, 2021 06:07
-
-
Save fruch/741c7e49e808898212822e971d642d55 to your computer and use it in GitHub Desktop.
Putting old browsers versions with their chrome drivers in docker (chrome/firefox)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8 | |
#======== | |
# Chrome | |
#======== | |
# Check available versions here: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable | |
ARG CHROME_VERSION="84.0.4147.125-1" | |
RUN apt-get update -qqy \ | |
&& wget --no-verbose -O /tmp/chrome.deb http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \ | |
&& apt-get install --no-install-recommends -y /tmp/chrome.deb \ | |
&& rm /tmp/chrome.deb \ | |
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | |
#============== | |
# Chromedriver | |
#============== | |
RUN apt-get install -yqq unzip | |
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_84`/chromedriver_linux64.zip | |
RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ | |
#========= | |
# Firefox | |
#========= | |
ARG FIREFOX_VERSION=79.0 | |
RUN apt-get update -qqy \ | |
&& apt-get -qqy --no-install-recommends install firefox-esr \ | |
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ | |
&& wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \ | |
&& apt-get -y purge firefox-esr \ | |
&& rm -rf /opt/firefox \ | |
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \ | |
&& rm /tmp/firefox.tar.bz2 \ | |
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \ | |
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox | |
#============ | |
# GeckoDriver | |
#============ | |
ARG GECKODRIVER_VERSION=0.27.0 | |
RUN wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz \ | |
&& rm -rf /opt/geckodriver \ | |
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \ | |
&& rm /tmp/geckodriver.tar.gz \ | |
&& mv /opt/geckodriver /opt/geckodriver-$GECKODRIVER_VERSION \ | |
&& chmod 755 /opt/geckodriver-$GECKODRIVER_VERSION \ | |
&& ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/bin/geckodriver | |
ENV DISPLAY=:99 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment