dockerselenium-chromedrivernightwatch.jsselenium-server

Nightwatch in Docker - selenium-server can't find chromedriver


I am trying to launch Nightwatch inside a Docker container.

I am getting an error from selenium-server which basically states that chromedriver could not be found. I can manually verify that the file that (I think) it's looking for does exist.

I have created a sample repository to demonstrate the issue: https://github.com/hvolschenk/nightwatch-docker


Solution

  • Got this working, had to change my Dockerfile a bit.

    FROM openjdk:latest
    
    RUN wget -q -O - https://dl.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
    
    RUN apt-get update
    RUN apt-get install -y curl
    RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
    RUN apt-get install -y nodejs
    
    RUN apt-get install --no-install-recommends -y google-chrome-stable
    
    WORKDIR /home/node/app
    
    CMD ["npm", "test"]
    EXPOSE 5555
    

    So, as opposed to adding openjdk from a node image, I am adding node to an openjdk image.

    Still not quite sure why the previous iteration didn't work, regardless, got to move forward.

    Edit:

    I also found a way to run this from a node docker image with the following Dockerfile:

    FROM node:carbon
    
    RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
    RUN apt-get update && apt-get install -t jessie-backports -y openjdk-8-jre
    
    RUN wget -q -O - https://dl.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
    RUN apt-get update && apt-get install --no-install-recommends -y google-chrome-stable
    
    ENV HOME /home/node/app
    WORKDIR /home/node/app
    VOLUME ["/home/node/app"]
    
    RUN chown -Rv node:node /home/node/app
    USER node
    
    CMD ["npm", "test"]
    EXPOSE 5555