cypress-docker-images icon indicating copy to clipboard operation
cypress-docker-images copied to clipboard

Add Arm browsers to `linux/arm64` Docker images

Open flotwig opened this issue 2 years ago • 19 comments

Currently, the browsers and included image series do not ship with any browsers except --browser electron. The blocker is the lack of official support from browser vendors.

Users must manually find and install other Arm builds in order to use non-Electron browsers with the linux/arm64 images.

As browser vendors make official Arm builds available, Cypress should update existing linux/arm64 images to include them.

Upstream tracking issues:

  • Google Chrome Linux arm64 support: https://crbug.com/677140
  • Mozilla Firefox Linux arm64 support: https://bugzilla.mozilla.org/show_bug.cgi?id=1678342
  • Microsoft Edge Linux arm64 support: https://techcommunity.microsoft.com/t5/discussions/edge-for-linux-arm64/m-p/1532272

flotwig avatar Jun 30 '22 19:06 flotwig

does cypress/base:14.7.0 support arm/64 arch ? if not is any of the base images does ? I always see the warning that IMAGE MAY HAVE POOR PERFORMANCE, OR FAIL, IF RUN VIA EMULATION when trying to run a container which has base image from cypress

Elwazer007 avatar Jul 13 '22 05:07 Elwazer007

@Elwazer007 none of the cypress images do yet. but look out for #700 to merge soon and close #431

flotwig avatar Jul 13 '22 16:07 flotwig

Why not include chromium? Chromium has a package for ARM on linux.

FarhanShoukat avatar Oct 20 '22 07:10 FarhanShoukat

@FarhanShoukat I recommend building a Docker image off of our images that includes Chromium. We chose not to ship an Arm image with Chromium for a few reasons:

a. It would require users to use a different invocation on Arm vs. on non-Arm (--browser chromium vs --browser chrome). b. This issue is a temporary condition, that will be resolved once upstream browser vendors build for Arm, at which point we will re-issue the browsers images on Arm. c. It's not difficult for users to build their own images that include Chromium if they really need to test on a non-Electron browser on M1/other Arm environments.

flotwig avatar Nov 02 '22 18:11 flotwig

@flotwig thank you for your response. I have already built my based on node. It made sense because I don't really extra stuff like electron. It was just a suggestion that maybe have an image with Chromium as well. We already have images with Chrome, Firefox and Edge. Chromium would a good addition in my opinion.

FarhanShoukat avatar Nov 03 '22 04:11 FarhanShoukat

But why not use Chromium instead of Google Chrome everywhere ?

kedare avatar Feb 24 '23 15:02 kedare

With our new cypress/factory pattern we could add a chromium install script but not install it by default in the browsers image to avoid making the cypress/browsers or cypress/included images larger.

I'd definitely be open to a contribution on this.

mjhenkes avatar Mar 01 '23 15:03 mjhenkes

Seems running with --platform linux/amd64 helps. Read more there: https://docs.docker.com/build/building/multi-platform/

deser avatar Mar 13 '23 22:03 deser

@deser could you elaborate on how you got that to work with --plaftorm linux/amd64? Do you mean you were able to run cypress/included x64 containers on an ARM host/workstation?

I have a few colleagues who'd like to run this on an M1 mac and get a segfault.

nejch avatar Mar 30 '23 13:03 nejch

I also need chrome for arm architecture, any progress?

hongdeyuan avatar May 16 '23 03:05 hongdeyuan

@nejch I got Chrome to run on an M1 Mac by enabling Rosetta 2 emulation and using --platform linux/amd64.

Install Rosetta 2 with softwareupdate --install-rosetta Enable Rosetta emulation by following these instructions Start a container docker run --rm --platform linux/amd64 cypress/included:latest --e2e --browser chrome

agrauch avatar May 16 '23 22:05 agrauch

But why not use Chromium instead of Google Chrome everywhere ?

I don't think this question has been adequately answered. I would understand the argument that Chromium is too much of a burden if it's only going to be a stopgap, but why shouldn't it replace Chrome permanently?

Google themselves say that you shouldn't use Chrome for testing. (ignore the fact that they recommend their new tool, Chrome for Testing, instead of Chromium 😄 )

danepowell avatar Aug 10 '23 22:08 danepowell

b. This issue is a temporary condition

@flotwig how temporary is temporary when this issue has already been opened for a year with no fix in sight?

re-thc avatar Aug 15 '23 09:08 re-thc

Any update on this issue?

t-ashraf avatar Nov 24 '23 13:11 t-ashraf

It's YEAR 4202 now! Any workaround here?

SunStupic avatar Jan 02 '24 10:01 SunStupic

FROM cypress/factory

ARG NODE_VERSION='20.9.0'

WORKDIR /e2e

RUN apt update && apt install -y chromium
RUN npm install --save-dev cypress

Works for me on M2 to run in Chromium.

enjikaka avatar Jan 10 '24 12:01 enjikaka