|
| 1 | +# build this image with command |
| 2 | +# docker build -t cypress/browsers-internal:node18.17.1-chrome128-ff130 --platform linux/amd64 . |
| 3 | +# |
| 4 | +FROM cypress/base-internal:18.17.1 |
| 5 | + |
| 6 | +USER root |
| 7 | + |
| 8 | +RUN node --version |
| 9 | + |
| 10 | +COPY ./global-profile.sh /tmp/global-profile.sh |
| 11 | +RUN cat /tmp/global-profile.sh >> /etc/bash.bashrc && rm /tmp/global-profile.sh |
| 12 | + |
| 13 | +# Install dependencies |
| 14 | +RUN apt-get update && \ |
| 15 | + apt-get install -y \ |
| 16 | + fonts-liberation \ |
| 17 | + git \ |
| 18 | + libcurl4 \ |
| 19 | + libcurl3-gnutls \ |
| 20 | + libcurl3-nss \ |
| 21 | + xdg-utils \ |
| 22 | + wget \ |
| 23 | + curl \ |
| 24 | + # chrome dependencies |
| 25 | + libu2f-udev \ |
| 26 | + # firefox dependencies |
| 27 | + bzip2 \ |
| 28 | + # add codecs needed for video playback in firefox |
| 29 | + # https://github.com/cypress-io/cypress-docker-images/issues/150 |
| 30 | + mplayer \ |
| 31 | + \ |
| 32 | + # clean up |
| 33 | + && rm -rf /var/lib/apt/lists/* \ |
| 34 | + && apt-get clean |
| 35 | + |
| 36 | +# install libappindicator3-1 - not included with Debian 11 |
| 37 | +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" && \ |
| 38 | + dpkg -i /usr/src/libappindicator3-1_0.4.92-7_amd64.deb ; \ |
| 39 | + apt-get install -f -y && \ |
| 40 | + rm -f /usr/src/libappindicator3-1_0.4.92-7_amd64.deb |
| 41 | + |
| 42 | +# install Chrome browser |
| 43 | +RUN node -p "process.arch === 'arm64' ? 'Not downloading Chrome since we are on arm64: https://crbug.com/677140' : process.exit(1)" || \ |
| 44 | + (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_128.0.6613.137-1_amd64.deb" && \ |
| 45 | + dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \ |
| 46 | + apt-get install -f -y && \ |
| 47 | + rm -f /usr/src/google-chrome-stable_current_amd64.deb) |
| 48 | + |
| 49 | +# "fake" dbus address to prevent errors |
| 50 | +# https://github.com/SeleniumHQ/docker-selenium/issues/87 |
| 51 | +ENV DBUS_SESSION_BUS_ADDRESS=/dev/null |
| 52 | + |
| 53 | +# install Firefox browser |
| 54 | +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)" || \ |
| 55 | + (wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/130.0.1/linux-x86_64/en-US/firefox-130.0.1.tar.bz2 && \ |
| 56 | + tar -C /opt -xjf /tmp/firefox.tar.bz2 && \ |
| 57 | + rm /tmp/firefox.tar.bz2 && \ |
| 58 | + ln -fs /opt/firefox/firefox /usr/bin/firefox) |
| 59 | + |
| 60 | +# versions of local tools |
| 61 | +RUN echo " node version: $(node -v) \n" \ |
| 62 | + "npm version: $(npm -v) \n" \ |
| 63 | + "yarn version: $(yarn -v) \n" \ |
| 64 | + "debian version: $(cat /etc/debian_version) \n" \ |
| 65 | + "Chrome version: $(google-chrome --version) \n" \ |
| 66 | + "Firefox version: $(firefox --version) \n" \ |
| 67 | + "Edge version: n/a \n" \ |
| 68 | + "git version: $(git --version) \n" \ |
| 69 | + "whoami: $(whoami) \n" |
| 70 | + |
| 71 | +# a few environment variables to make NPM installs easier |
| 72 | +# good colors for most applications |
| 73 | +ENV TERM=xterm |
| 74 | +# avoid million NPM install messages |
| 75 | +ENV npm_config_loglevel=warn |
| 76 | +# allow installing when the main user is root |
| 77 | +ENV npm_config_unsafe_perm=true |
0 commit comments