-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ed6e13
commit 76503de
Showing
2 changed files
with
103 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,84 @@ | ||
FROM cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 | ||
# Use Ubuntu 22.04 (Jammy) as the base image | ||
FROM ubuntu:jammy | ||
|
||
# Set Node.js version as a build argument | ||
ARG NODE=20 | ||
|
||
#ENV | ||
# Avoid any prompts | ||
ENV DEBIAN_FRONTEND noninteractive | ||
# a few environment variables to make NPM installs easier | ||
# good colors for most applications | ||
ENV TERM=xterm | ||
# avoid million NPM install messages | ||
ENV npm_config_loglevel=warn | ||
# allow installing when the main user is root | ||
ENV npm_config_unsafe_perm=true | ||
# "fake" dbus address to prevent errors | ||
# https://github.com/SeleniumHQ/docker-selenium/issues/87 | ||
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
|
||
USER root | ||
# Set environment variables for better npm experience | ||
ENV TERM xterm | ||
ENV npm_config_loglevel warn | ||
ENV npm_config_unsafe_perm true | ||
|
||
# Update the package manager and install necessary tools | ||
RUN apt-get update && \ | ||
apt-get install -y apt-transport-https ca-certificates curl gnupg build-essential git unzip wget | ||
|
||
# Add Node.js repository and install Node.js | ||
RUN mkdir -p /etc/apt/keyrings && \ | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ | ||
apt-get update && \ | ||
apt-get install -y nodejs | ||
|
||
RUN apt update -y && \ | ||
apt install -y \ | ||
unzip \ | ||
cmake \ | ||
build-essential \ | ||
tzdata \ | ||
# Install the latest NPM and Yarn | ||
RUN npm install -g npm@latest && \ | ||
npm install -g yarn@latest | ||
|
||
# Install additional dependencies | ||
RUN apt-get install -y \ | ||
libatk1.0-0 \ | ||
libgtk2.0-0 \ | ||
libglib2.0-0 \ | ||
libatk-bridge2.0-0 \ | ||
libcups2 \ | ||
libgtk-3-0 \ | ||
libgbm1 \ | ||
libnotify-dev \ | ||
libgconf-2-4 \ | ||
libnss3 \ | ||
libxss1 \ | ||
libasound2 \ | ||
xvfb \ | ||
dbus | ||
dbus \ | ||
cmake | ||
|
||
# Install Google Chrome browser | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | ||
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \ | ||
apt-get update && \ | ||
apt-get install -y dbus-x11 google-chrome-stable && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set "fake" DBUS address to prevent errors | ||
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
|
||
# Generate and print machine-id for DBUS | ||
RUN dbus-uuidgen > /var/lib/dbus/machine-id | ||
# dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address | ||
|
||
# Create a user named "runner" | ||
RUN mkdir -p /run/dbus | ||
|
||
# Start the DBUS service | ||
RUN service dbus start | ||
|
||
#DBUS | ||
RUN dbus-uuidgen > /var/lib/dbus/machine-id | ||
# Set the working directory | ||
WORKDIR /home/runner | ||
|
||
RUN service dbus start | ||
# Display version information | ||
RUN echo "Node version: $(node -v)" && \ | ||
echo "NPM version: $(npm -v)" && \ | ||
echo "Yarn version: $(yarn -v)" && \ | ||
echo "Debian version: $(cat /etc/debian_version)" && \ | ||
echo "User: $(whoami)" && \ | ||
echo "Git version: $(git --version)" | ||
|
||
RUN npm install -g node-gyp | ||
RUN npm install -g cpu-features | ||
# Display additional version information | ||
RUN cat /etc/lsb-release && \ | ||
cat /etc/os-release | ||
|
||
RUN rm -rf ~/.node_modules | ||
# Install CPU-features globally | ||
RUN npm install -g cpu-features |