Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromedriver not working with Alpine base docker image

I have one app, which uses alpine based image, and i have chrome driver in given directory(/usr/bin/chromedriver/linux64/2.45/chromedriver) with 755 permission.

I get below given error :

chromedriver-docker-example_1  | 2019-03-20 05:05:50.316 ERROR 21 --- [ null to remote] org.openqa.selenium.os.OsProcess         : org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/usr/bin/chromedriver/linux64/2.45/chromedriver" (in directory "."): error=2, No such file or directory)

Can please anyone help on this ?

like image 468
Bhagwati Malav Avatar asked Mar 20 '19 06:03

Bhagwati Malav


1 Answers

I was able to solve it, for alpine we need to install chromium driver, chromium. Add below given command to setup it.

RUN apk update && apk add --no-cache bash \
        alsa-lib \
        at-spi2-atk \
        atk \
        cairo \
        cups-libs \
        dbus-libs \
        eudev-libs \
        expat \
        flac \
        gdk-pixbuf \
        glib \
        libgcc \
        libjpeg-turbo \
        libpng \
        libwebp \
        libx11 \
        libxcomposite \
        libxdamage \
        libxext \
        libxfixes \
        tzdata \
        libexif \
        udev \
        xvfb \
        zlib-dev \
        chromium \
        chromium-chromedriver

And then point driver path to /usr/bin/chromedriver. This should solve given issue.

like image 138
Bhagwati Malav Avatar answered Oct 19 '22 18:10

Bhagwati Malav