Skip to content

Instantly share code, notes, and snippets.

@danilsmirnov
Forked from varyonic/Dockerfile
Last active November 29, 2021 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilsmirnov/7358aa06e63f00fe82ff44f4aa2eeb31 to your computer and use it in GitHub Desktop.
Save danilsmirnov/7358aa06e63f00fe82ff44f4aa2eeb31 to your computer and use it in GitHub Desktop.
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM python:3.9
RUN apt-get update -y
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
RUN apt-get install -y gnupg wget curl unzip --no-install-recommends && \
wget -q -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.list && \
apt-get update -y && \
apt-get install -y google-chrome-stable && \
CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \
DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") && \
wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \
unzip /chromedriver/chromedriver* -d /chromedriver && \
cp /chromedriver/chromedriver /usr/bin/chromedriver
@danilsmirnov
Copy link
Author

need to test this way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment