Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mbradleySoftrams authored Dec 16, 2024
1 parent b58181a commit 4606a88
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ FROM node:18
# 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.
# Install Google Chrome
RUN apt-get update && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt install --assume-yes \
libgbm-dev \
zip \
rsync \
./google-chrome-stable_current_amd64.deb \
&& rm google-chrome-stable_current_amd64.deb \
&& npm install -g @getgauge/cli \
&& npm install \
&& gauge install \
&& gauge install screenshot \
&& gauge config check_updates false

RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates vim \
&& 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 \
&& apt-get install -y unzip

# Install Oracle Client
RUN mkdir -p /opt/oracle && \
cd /opt/oracle && \
Expand All @@ -33,3 +26,30 @@ RUN mkdir -p /opt/oracle && \
sh -c "echo /opt/oracle/instantclient_21_4 > /etc/ld.so.conf.d/oracle-instantclient.conf" && \
ldconfig

# Commented out to verify if needed
# RUN cp /usr/share/zoneinfo/America/New_York /etc/localtime

# Set a custom npm install location so that Gauge, Taiko and dependencies can be
# installed without root privileges
ENV NPM_CONFIG_PREFIX=/home/gauge/.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

# Set working directory
WORKDIR /gauge

# Create an unprivileged user to run Taiko tests
RUN groupadd -r gauge && useradd -r -g gauge -G audio,video gauge && \
mkdir -p /home/gauge/.npm-packages/lib && \
chown -R gauge:gauge /home/gauge /gauge

USER gauge

RUN npm install -g @getgauge/cli \
&& gauge install screenshot \
&& gauge config check_updates false

0 comments on commit 4606a88

Please sign in to comment.