Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cmbaughman
Forked from zhunhung/DockerFile
Created August 7, 2020 16:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbaughman/50cff7fa9362948ca4a6d00d3589c0f4 to your computer and use it in GitHub Desktop.
Save cmbaughman/50cff7fa9362948ca4a6d00d3589c0f4 to your computer and use it in GitHub Desktop.
Selenium Linux DockerFile
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
# INSTALL DEPENDENCIES
RUN apt-get install -y curl unzip openjdk-8-jre-headless xvfb libxi6 libgconf-2-4
# INSTALL CHROME
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get -y update \
&& apt-get -y install google-chrome-stable
# INSTALL CHROMEDRIVER
RUN wget -N https://chromedriver.storage.googleapis.com/79.0.3945.36/chromedriver_linux64.zip -P ~/ \
&& unzip ~/chromedriver_linux64.zip -d ~/ \
&& rm ~/chromedriver_linux64.zip \
&& mv -f ~/chromedriver /usr/local/bin/chromedriver \
&& chown root:root /usr/local/bin/chromedriver \
&& chmod 0755 /usr/local/bin/chromedriver
# INSTALL SELENIUM
RUN pip install selenium
# RUN TEST SCRIPT
COPY test_selenium.py test_selenium.py
CMD ["python3", "test_selenium.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment