Skip to content

Instantly share code, notes, and snippets.

@pako88
Created May 14, 2020 04:57
Show Gist options
  • Select an option

  • Save pako88/6eb8e48068ed14f333bebf943e866b16 to your computer and use it in GitHub Desktop.

Select an option

Save pako88/6eb8e48068ed14f333bebf943e866b16 to your computer and use it in GitHub Desktop.
Dockerize WDIO
FROM node:lts
RUN apt-get update \
&& apt-get install -y python-pip jq \
#add google repository to apt source list to install google-chrome-unstable
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] 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 --no-install-recommends \
&& pip install yq \
#clean python-pip
&& apt-get --purge autoremove -y python-pip \
&& rm -rf /var/lib/apt/lists/*
RUN node --version \
&& npm --version \
&& google-chrome --version
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=0
ENV CHROME_PATH="/opt/google/chrome/chrome"
ENV PUPPETEER_EXECUTABLE_PATH="/opt/google/chrome/chrome"
ENV PATH="/usr/local/lib/node_modules/global/node_modules/.bin/:$PATH"
ADD . /wdio
WORKDIR /wdio
RUN npm i
docker run --rm -ti containername ./node_modules/.bin/wdio config.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment