Skip to content
Snippets Groups Projects
Unverified Commit d5ed7d0d authored by Varac's avatar Varac
Browse files

Add Dockerfile.taiko

parent 04f44155
No related branches found
No related tags found
No related merge requests found
# 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 [""]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment