From d5ed7d0d99d57f47eb422182d811d11a2a37843f Mon Sep 17 00:00:00 2001 From: Varac <varac@varac.net> Date: Thu, 10 Jun 2021 23:46:13 +0200 Subject: [PATCH] Add Dockerfile.taiko --- Dockerfile.taiko | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Dockerfile.taiko diff --git a/Dockerfile.taiko b/Dockerfile.taiko new file mode 100644 index 000000000..fa2ed8ced --- /dev/null +++ b/Dockerfile.taiko @@ -0,0 +1,60 @@ +# vi: filetype=Dockerfile +# https://docs.taiko.dev/taiko_in_docker/ +# https://github.com/getgauge/template-js/blob/master/Dockerfile +# Building the image +# docker build -t taiko . + +# This image uses the official node base image. +FROM node:16.3.0-buster + +# The Taiko installation downloads and installs the chromium required to run the tests. +# However, we need the chromium dependencies installed in the environment. These days, most +# Dockerfiles just install chrome to get the dependencies. +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + wget=1.20.1-1.1 \ + gnupg=2.2.12-1+deb10u1 \ + ca-certificates=20200601~deb10u2 \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && 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 --no-install-recommends -y \ + google-chrome-stable=91.0.4472.101-1 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + + +# Set a custom npm install location so that Taiko and dependencies can be +# installed without root privileges +ENV NPM_CONFIG_PREFIX=/home/taiko/.npm-packages +ENV PATH="${NPM_CONFIG_PREFIX}/bin:${PATH}" + +# Add the Taiko browser arguments +ENV TAIKO_BROWSER_ARGS=--no-sandbox,--start-maximized,--disable-dev-shm-usage +ENV headless_chrome=true +ENV TAIKO_SKIP_DOCUMENTATION=true + +# Uncomment the lines below to use chrome bundled with this image +#ENV TAIKO_SKIP_CHROMIUM_DOWNLOAD=true +#ENV TAIKO_BROWSER_PATH=/usr/bin/google-chrome + +# Set working directory +WORKDIR /taiko + +# Copy the local working folder +# COPY . . + +# Create an unprivileged user to run Taiko tests +RUN groupadd -r taiko && useradd -r -g taiko -G audio,video taiko && \ + mkdir -p /home/taiko/.npm-packages/lib && \ + chown -R taiko:taiko /home/taiko /taiko + +USER taiko + +# Install dependencies and plugins +RUN npm install -g taiko@1.2.5 + +# Default command on running the image +ENTRYPOINT [""] -- GitLab