cypress-io / cypress-docker-images

Docker images with Cypress dependencies and browsers
https://on.cypress.io/continuous-integration
MIT License
1.03k stars 381 forks source link

Add Firefox to Linux/arm64 browser images #1190

Open MikeMcC399 opened 3 months ago

MikeMcC399 commented 3 months ago

What would you like?

Add Mozilla Firefox to Linux/arm64 browser images when this browser becomes available for arm64 on Linux via the cdn release location https://download-installer.cdn.mozilla.net/pub/firefox/releases/.

Why is this needed?

Firefox is needed on Linux/arm64 to complement the availability on Linux/amd64 Cypress Docker images.

Mozilla is currently providing Firefox for arm64 on the nightly channel. See Firefox Nightly Now Available for Linux on ARM64 aka AArch64.

Other

Upstream status

lhridley commented 3 months ago

I built a custom cypress docker image with both Chromium and Firefox installed to execute Cypress tests on a Macbook Pro M3 Max. Both install and execute tests without issue. I did switch to Firefox ESR for more stability in testing, but Firefox Rapid Release also works without a problem.

Why is this still an open issue?

MikeMcC399 commented 3 months ago

@lhridley

I built a custom cypress docker image with both Chromium and Firefox installed to execute Cypress tests on a Macbook Pro M3 Max. Both install and execute tests without issue. I did switch to Firefox ESR for more stability in testing, but Firefox Rapid Release also works without a problem.

It's great to hear that you were able to run Cypress tests on a MacBook Pro M3 Max with Firefox!

Could you share how you built your custom Cypress Docker image including Firefox? What was your download location for arm64 / aarch64 versions of Firefox for Linux?

lhridley commented 3 months ago

Ok to clarify a bit (I did leave something out here)...we are using DDEV for local development for Drupal sites, and to also build and test projects in our CI/CD pipeline.

DDEV web images are, at their base, Debian slim images, with PHP, NginX, and NodeJS (v20) installed. The current images are based on Debian "bookworm" (version 12). The base image that is used as the starting point depends on the host system, which in my case is Apple Silicon (aarch64).

With DDEV you can add additional build instructions to the base images before the dev environment spins up.

I have logic in in the additional build instructions that is based on the Dockerfile for the Cypress browsers-internal image for NodeJS 20, including the logic from lines 14 - 75, with the following changes:

I then install cypress with npm after the web image spins up.

Since the current base image for NodeJS 20 for Cypress also uses Debian Slim bookwork, it logically makes sense that the base image can be modified to install chromium and firefox by default, and only check the processor type before attempting to install Chrome or Edge.

At least in this case, you get three browsers for testing using a docker image on ARM based processor machines.

MikeMcC399 commented 3 months ago

@lhridley

Many thanks for your description! I hadn't realized that Firefox is also available from Debian for arm64 and nobody had mentioned it previously. Thanks to your feedback I found it on https://wiki.debian.org/Firefox! We can take account of this for future planning.

MikeMcC399 commented 3 months ago

I've asked in https://bugzilla.mozilla.org/show_bug.cgi?id=1678342 if there is any update.

https://blog.nightly.mozilla.org/2024/04/19/firefox-nightly-now-available-for-linux-on-arm64/in April 2024 said:

Our goal is to integrate ARM64 builds into Firefox’s extensive automated test suite, which will enable us to offer this architecture across the beta, release, and ESR channels.

so it would be good to know when this is going to be Generally Available.