Skip to content

Commit

Permalink
adding internal node 20.18.1 docker images (#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile authored Dec 6, 2024
1 parent c61c638 commit d89564b
Show file tree
Hide file tree
Showing 17 changed files with 466 additions and 0 deletions.
56 changes: 56 additions & 0 deletions base-internal/releases/node-20/20.18.1-bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# build it with command
# docker build -t cypress/base-internal:20.18.1-bullseye --platform linux/amd64 .
#
FROM node:20.18.1-bullseye-slim

RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
procps \
xauth \
xvfb \
build-essential \
# install text editors
vim-tiny \
nano \
# install emoji font
fonts-noto-color-emoji \
# install Chinese fonts
# this list was copied from https://github.com/jim3ma/docker-leanote
fonts-arphic-bkai00mp \
fonts-arphic-bsmi00lp \
fonts-arphic-gbsn00lp \
fonts-arphic-gkai00mp \
fonts-arphic-ukai \
fonts-arphic-uming \
ttf-wqy-zenhei \
ttf-wqy-microhei \
xfonts-wqy \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# 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

RUN npm --version \
&& npm install -g yarn@latest --force \
&& yarn --version \
&& node -p process.versions \
&& node -p 'module.paths' \
&& echo " node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v) \n" \
"debian version: $(cat /etc/debian_version) \n" \
"user: $(whoami) \n"
14 changes: 14 additions & 0 deletions base-internal/releases/node-20/20.18.1-bullseye/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# cypress/base-internal:20.18.1-bullseye

A Docker image with all dependencies pre-installed.

NOTE: This image is intended for internal use with https://github.com/cypress-io/cypress. It contains a few differences from the factory, such as:

#### Dependency Additions

- xauth (to run xvfb inside system-tests)
- build-essential to install `make` and other linux build packages

#### Env variables

- Does not contain the `CACHE_FOLDER` and `FACTORY_DEFAULT_NODE_VERSION` env variables to keep unit tests non environment specific
7 changes: 7 additions & 0 deletions base-internal/releases/node-20/20.18.1-bullseye/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set e+x

# build image with Cypress dependencies
LOCAL_NAME=cypress/base-internal:20.18.1-bullseye

echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
68 changes: 68 additions & 0 deletions base-internal/releases/node-20/20.18.1-yarn-berry/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# build it with command
# docker build -t cypress/base-internal:20.18.1-yarn-berry --platform linux/amd64 .
#
FROM node:20.18.1-bookworm-slim

RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
procps \
xauth \
xvfb \
build-essential \
# install text editors
vim-tiny \
nano \
wget \
curl \
git \
# install emoji font
fonts-noto-color-emoji \
# install Chinese fonts
# this list was copied from https://github.com/jim3ma/docker-leanote
fonts-arphic-bkai00mp \
fonts-arphic-bsmi00lp \
fonts-arphic-gbsn00lp \
fonts-arphic-gkai00mp \
fonts-arphic-ukai \
fonts-arphic-uming \
ttf-wqy-zenhei \
ttf-wqy-microhei \
xfonts-wqy \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN apt-get update && \
apt-get install --no-install-recommends -y \
ca-certificates

# 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
# need to enable corepack to set yarn version
RUN corepack enable
# set the yarn version to 4 to get yarn berry, which does not install modules into node_modules
RUN yarn set version 4.3.1

RUN npm --version \
&& yarn --version \
&& node -p process.versions \
&& node -p 'module.paths' \
&& echo " node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v) \n" \
"debian version: $(cat /etc/debian_version) \n" \
"user: $(whoami) \n"
13 changes: 13 additions & 0 deletions base-internal/releases/node-20/20.18.1-yarn-berry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# cypress/base-internal:20.18.1-yarn-berry

A Docker image with all dependencies pre-installed.

NOTE: This image is intended for internal use with https://github.com/cypress-io/cypress. It contains a few differences from the factory, such as:

#### Dependency Additions
* xauth (to run xvfb inside system-tests)
* build-essential to install `make` and other linux build packages
* has yarn 4 to test yarn PnP dependencies with Cypress in order to verify the `@cypress/webpack-batteries-included-preprocessor` works with yarn PnP (without `node_modules`)

#### Env variables
* Does not contain the `CACHE_FOLDER` and `FACTORY_DEFAULT_NODE_VERSION` env variables to keep unit tests non environment specific
7 changes: 7 additions & 0 deletions base-internal/releases/node-20/20.18.1-yarn-berry/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set e+x

# build image with Cypress dependencies
LOCAL_NAME=cypress/base-internal:20.18.1-yarn-berry

echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
56 changes: 56 additions & 0 deletions base-internal/releases/node-20/20.18.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# build it with command
# docker build -t cypress/base-internal:20.18.1 --platform linux/amd64 .
#
FROM node:20.18.1-bookworm-slim

RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgtk2.0-0 \
libgtk-3-0 \
libnotify-dev \
libgconf-2-4 \
libgbm-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
procps \
xauth \
xvfb \
build-essential \
# install text editors
vim-tiny \
nano \
# install emoji font
fonts-noto-color-emoji \
# install Chinese fonts
# this list was copied from https://github.com/jim3ma/docker-leanote
fonts-arphic-bkai00mp \
fonts-arphic-bsmi00lp \
fonts-arphic-gbsn00lp \
fonts-arphic-gkai00mp \
fonts-arphic-ukai \
fonts-arphic-uming \
ttf-wqy-zenhei \
ttf-wqy-microhei \
xfonts-wqy \
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# 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

RUN npm --version \
&& npm install -g yarn@latest --force \
&& yarn --version \
&& node -p process.versions \
&& node -p 'module.paths' \
&& echo " node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v) \n" \
"debian version: $(cat /etc/debian_version) \n" \
"user: $(whoami) \n"
14 changes: 14 additions & 0 deletions base-internal/releases/node-20/20.18.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# cypress/base-internal:20.18.1

A Docker image with all dependencies pre-installed.

NOTE: This image is intended for internal use with https://github.com/cypress-io/cypress. It contains a few differences from the factory, such as:

#### Dependency Additions

- xauth (to run xvfb inside system-tests)
- build-essential to install `make` and other linux build packages

#### Env variables

- Does not contain the `CACHE_FOLDER` and `FACTORY_DEFAULT_NODE_VERSION` env variables to keep unit tests non environment specific
7 changes: 7 additions & 0 deletions base-internal/releases/node-20/20.18.1/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set e+x

# build image with Cypress dependencies
LOCAL_NAME=cypress/base-internal:20.18.1

echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# build this image with command
# docker build -t cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133 --platform linux/amd64 .
#
FROM cypress/base-internal:20.18.1-bullseye

USER root

RUN node --version

COPY ./global-profile.sh /tmp/global-profile.sh
RUN cat /tmp/global-profile.sh >> /etc/bash.bashrc && rm /tmp/global-profile.sh

# Install dependencies
RUN apt-get update && \
apt-get install -y \
fonts-liberation \
git \
libcurl4 \
libcurl3-gnutls \
libcurl3-nss \
libvulkan1 \
xdg-utils \
wget \
curl \
# chrome dependencies
libu2f-udev \
# firefox dependencies
bzip2 \
# add codecs needed for video playback in firefox
# https://github.com/cypress-io/cypress-docker-images/issues/150
mplayer \
\
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# install libappindicator3-1 - not included with Debian 11
RUN wget --no-verbose /usr/src/libappindicator3-1_0.4.92-7_amd64.deb "http://ftp.us.debian.org/debian/pool/main/liba/libappindicator/libappindicator3-1_0.4.92-7_amd64.deb" && \
dpkg -i /usr/src/libappindicator3-1_0.4.92-7_amd64.deb ; \
apt-get install -f -y && \
rm -f /usr/src/libappindicator3-1_0.4.92-7_amd64.deb

# install Chrome browser
RUN node -p "process.arch === 'arm64' ? 'Not downloading Chrome since we are on arm64: https://crbug.com/677140' : process.exit(1)" || \
(wget --no-verbose -O /usr/src/google-chrome-stable_current_amd64.deb "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_131.0.6778.108-1_amd64.deb" && \
dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \
apt-get install -f -y && \
rm -f /usr/src/google-chrome-stable_current_amd64.deb)

# "fake" dbus address to prevent errors
# https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

# install Firefox browser
RUN node -p "process.arch === 'arm64' ? 'Not downloading Firefox since we are on arm64: https://bugzilla.mozilla.org/show_bug.cgi?id=1678342' : process.exit(1)" || \
(wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/133.0/linux-x86_64/en-US/firefox-133.0.tar.bz2 && \
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
rm /tmp/firefox.tar.bz2 && \
ln -fs /opt/firefox/firefox /usr/bin/firefox)

# versions of local tools
RUN echo " node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v) \n" \
"debian version: $(cat /etc/debian_version) \n" \
"Chrome version: $(google-chrome --version) \n" \
"Firefox version: $(firefox --version) \n" \
"Edge version: n/a \n" \
"git version: $(git --version) \n" \
"whoami: $(whoami) \n"

# 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133

A complete image with all operating system dependencies for Cypress, and Chrome 131.0.6778.108-1, Firefox 133.0 browsers.

NOTE: This image is intended for internal use with https://github.com/cypress-io/cypress. It contains a few differences from the factory, such as:

#### Dependency Additions

- curl
- build-essentials (to contain `make` and a few other dependencies)

#### Env variables

- Does not contain the `CACHE_FOLDER` and `FACTORY_DEFAULT_NODE_VERSION` env variables to keep unit tests non environment specific

[Dockerfile](Dockerfile)

**Note:** this image uses the `root` user. You might want to switch to non-root user like `node` when running this container for security

**Note:** Currently, the linux/arm64 build of this image does not contain any browsers except Electron. See https://github.com/cypress-io/cypress-docker-images/blob/master/README.md#browsers for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set e+x

LOCAL_NAME=cypress/browsers-internal:node20.18.1-bullseye-chrome131-ff133
echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if [[ "$(uname -a)" = *"arm"* || "$(uname -a)" = *"aarch64"* ]]; then
printf "\e[31m" # red
echo "Warning: You are using the beta Arm build of a cypress/browsers or cypress/included image."
echo
echo "On Arm, non-Electron browsers are not available, because browser vendors are not yet building for Linux arm64."
echo "You must use the built-in Electron browser (--browser electron) to run Cypress or find and install unofficial Arm binary builds."
echo
echo "More details and links to upstream issues for Chrome, Firefox, and Edge can be found in the docker image ReadMe:"
echo " https://github.com/cypress-io/cypress-docker-images/blob/master/README.md#browsers"
printf "\e[0m" # reset
fi
Loading

0 comments on commit d89564b

Please sign in to comment.