Created
June 10, 2016 14:14
-
-
Save varyonic/dea40abcf3dd891d204ef235c6e8dd79 to your computer and use it in GitHub Desktop.
Dockerfile with chromedriver
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
# See https://codeship.com/documentation/docker/browser-testing/ | |
FROM myapp:base | |
# 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 | |
# Set up the Chrome PPA | |
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | |
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list | |
# Update the package list and install chrome | |
RUN apt-get update -y | |
RUN apt-get install -y google-chrome-stable | |
# Set up Chromedriver Environment variables | |
ENV CHROMEDRIVER_VERSION 2.19 | |
ENV CHROMEDRIVER_DIR /chromedriver | |
RUN mkdir $CHROMEDRIVER_DIR | |
# Download and install Chromedriver | |
RUN wget -q --continue -P $CHROMEDRIVER_DIR "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" | |
RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR | |
# Put Chromedriver into the PATH | |
ENV PATH $CHROMEDRIVER_DIR:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get this error do you really need so many dependencies, i am using python:3.11.2-slim-bullseye as base:
RUN apt-get install -y libxss1 libappindicator1 libgconf-2-4 fonts-liberation libasound2 libnspr4 libnss3 libx11-xcb1 libxtst6 lsb-release xdg-utils libgbm1 libnss3 libatk-bridge2.0-0 libgtk-3-0 libx11-xcb1 libxcb-dri3-0
---> Running in ef18a231d6fa
Reading package lists...
Building dependency tree...
Reading state information...
Package fonts-liberation is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libasound2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package xdg-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package libxss1
E: Unable to locate package libappindicator1
E: Unable to locate package libgconf-2-4
E: Package 'fonts-liberation' has no installation candidate
E: Package 'libasound2' has no installation candidate
E: Unable to locate package libnspr4
E: Unable to locate package libnss3
E: Unable to locate package libxtst6
E: Unable to locate package lsb-release
E: Package 'xdg-utils' has no installation candidate
E: Unable to locate package libgbm1
E: Unable to locate package libnss3
E: Unable to locate package libatk-bridge2.0-0
E: Couldn't find any package by glob 'libatk-bridge2.0-0'
E: Couldn't find any package by regex 'libatk-bridge2.0-0'
E: Unable to locate package libgtk-3-0