Created
October 12, 2018 17:25
-
-
Save bbrooks/502c10449dfec74be7d0c8bb56903b75 to your computer and use it in GitHub Desktop.
This file contains 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 ruby:2.4.1 | |
WORKDIR /wraith | |
RUN gem install wraith --no-rdoc --no-ri | |
# install chrome and chromedriver (unzip is needed for installing chromedriver) | |
RUN 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 \ | |
&& apt-get install -y google-chrome-stable unzip \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' \ | |
"/opt/google/chrome/google-chrome" \ | |
&& google-chrome --version | |
RUN export CHROMEDRIVER_RELEASE=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE) \ | |
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/chromedriver_linux64.zip "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_RELEASE/chromedriver_linux64.zip" \ | |
&& cd /tmp \ | |
&& unzip chromedriver_linux64.zip \ | |
&& rm -rf chromedriver_linux64.zip \ | |
&& mv chromedriver /usr/local/bin/chromedriver \ | |
&& chmod +x /usr/local/bin/chromedriver \ | |
&& chromedriver --version | |
# Make sure a recent (>6.7.7-10) version of ImageMagick is installed. | |
RUN apt-get install -y imagemagick | |
ENTRYPOINT [ "wraith" ] |
When you run this you'll want to add --shm-size=4g
to the docker run
command to give Chrome enough resources not to crash.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relevant discussion: bbc/wraith#565