Skip to content

Commit

Permalink
feat: add browser image based on node 14.15.0 (cypress-io#399)
Browse files Browse the repository at this point in the history
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
  • Loading branch information
SimenB and bahmutov authored Nov 13, 2020
1 parent c31c2d9 commit a50a8d4
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions browsers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Name + Tag | Base image | Chrome | Firefox | Edge
[cypress/browsers:node14.7.0-chrome84](./node14.7.0-chrome84) | `cypress/base:14.7.0` | `84.0.4147.105` | 🚫
[cypress/browsers:node12.14.1-chrome85-ff81](./node12.14.1-chrome85-ff81) | `cypress/base:12.14.1` | `85.0.4183.121` | `81.0`
[cypress/browsers:node14.10.1-edge88](./node14.10.1-edge88) | `cypress/base:14.10.1` | 🚫 | 🚫 | `88.0.673.0 dev`
[cypress/browsers:node14.15.0-chrome86-ff82](./node14.15.0-chrome86-ff82) | `cypress/base:14.15.0` | `86.0.4240.193` | `82.0.3`

## Naming scheme

Expand Down
53 changes: 53 additions & 0 deletions browsers/node14.15.0-chrome86-ff82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM cypress/base:14.15.0

USER root

RUN node --version

# Chrome dependencies
RUN apt-get update
RUN apt-get install -y fonts-liberation libappindicator3-1 xdg-utils

# install Chrome browser
ENV CHROME_VERSION 86.0.4240.193
RUN wget -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_${CHROME_VERSION}-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
RUN google-chrome --version

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

# Add zip utility - it comes in very handy
RUN apt-get update && apt-get install -y zip

# add codecs needed for video playback in firefox
# https://github.com/cypress-io/cypress-docker-images/issues/150
RUN apt-get install mplayer -y

# install Firefox browser
ARG FIREFOX_VERSION=82.0.3
RUN wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.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" \
"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
# allow installing when the main user is root
ENV npm_config_unsafe_perm true
19 changes: 19 additions & 0 deletions browsers/node14.15.0-chrome86-ff82/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# cypress/browsers:node14.15.0-chrome86-ff82

A complete image with all operating system dependencies for Cypress, Chrome
86 and Firefox 82 browsers.

[Dockerfile](Dockerfile)

```text
node version: v14.15.0
npm version: 6.14.8
yarn version: 1.22.10
debian version: 10.6
Chrome version: Google Chrome 86.0.4240.193
Firefox version: Mozilla Firefox 82.0.3
git version: git version 2.20.1
```

**Note:** this image uses the `root` user. You might want to switch to non-root
user like `node` when running this container for security.
6 changes: 6 additions & 0 deletions browsers/node14.15.0-chrome86-ff82/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set e+x

LOCAL_NAME=cypress/browsers:node14.15.0-chrome86-ff82

echo "Building $LOCAL_NAME"
docker build -t $LOCAL_NAME .
5 changes: 5 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ workflows:
name: "browsers node14.7.0-chrome84"
dockerTag: "node14.7.0-chrome84"
chromeVersion: "Google Chrome 84"
- build-browser-image:
name: "browsers node14.15.0-chrome86-ff82"
dockerTag: "node14.15.0-chrome86-ff82"
chromeVersion: "Google Chrome 86"
firefoxVersion: "Mozilla Firefox 82"

build-included-images:
jobs:
Expand Down

0 comments on commit a50a8d4

Please sign in to comment.