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

Unable to run Cypress test on Chrome and Firefox Browsers using Docker in Apple M1 chip

Open Anshita-Bhasin opened this issue 2 years ago • 4 comments

Current behavior

Unable to run Cypress test on Chrome and Firefox Browsers using Docker in Apple M1 chip.

It works fine, locally for chrome and firefox but there is issue while running using the Docker command. A similar thing works fine on Mac Intel Chip.

Command : docker run -it -v $PWD:/e2e -w /e2e cypress/included:12.8.1 --browser firefox

image

While executing, without using Docker image

Also, used cypress/factory Image ( Dockerfile)

# Args are defined in the Dockerfile before the FROM command.
# Using these args will cause an image to be created with node (default version is 16.18.1), chrome, firefox and edge.
ARG CHROME_VERSION='107.0.5304.121-1'
ARG EDGE_VERSION='100.0.1185.29-1'
ARG FIREFOX_VERSION='107.0'

FROM cypress/factory

COPY . /opt/app
WORKDIR /opt/app
RUN npm install --save-dev cypress

But same issue observed in Apple M1 Chip

Desired behavior

Should be able to run on the specified behaviour.

Test code to reproduce

Command: docker run -it -v $PWD:/e2e -w /e2e cypress/included:12.8.1 --browser firefox

Dockerfile:

`# Args are defined in the Dockerfile before the FROM command.

Using these args will cause an image to be created with node (default version is 16.18.1), chrome, firefox and edge.

ARG CHROME_VERSION='107.0.5304.121-1' ARG EDGE_VERSION='100.0.1185.29-1' ARG FIREFOX_VERSION='107.0'

FROM cypress/factory

COPY . /opt/app WORKDIR /opt/app RUN npm install --save-dev cypress`

Cypress Version

12.7.0

Node version

16.7.0

Operating System

MAC OS 12.6 (Apple M1) - MAC OS Monterey

Debug Logs

No response

Other

No response

Anshita-Bhasin avatar Mar 22 '23 02:03 Anshita-Bhasin

I moved this to the docker images repo.

lmiller1990 avatar Mar 22 '23 04:03 lmiller1990

Can you take a look here: https://github.com/cypress-io/cypress-docker-images/issues/862 (this has some info, it's docker and docker + firefox specific, though).

I checked with @mjhenkes who knows the docker images better than myself - "browser don’t get installed an M1. I think you can force it to the amd64 image, but don’t know how off hand".

I'm not sure why this is the case - I'll mark this as a known issue and enhancement, since it would be good to install the browsers on M1 + docker.

lmiller1990 avatar Mar 22 '23 04:03 lmiller1990

See this issue: https://github.com/cypress-io/cypress-docker-images/issues/695

mjhenkes avatar Mar 23 '23 20:03 mjhenkes

Specifically, mozilla doesn't build an arm package

https://bugzilla.mozilla.org/show_bug.cgi?id=1678342

mjhenkes avatar Mar 23 '23 20:03 mjhenkes

For current status running with arm64 processors:

  • https://github.com/cypress-io/cypress-docker-images/issues/1188
  • https://github.com/cypress-io/cypress-docker-images/issues/1190

Additionally, refer to examples/firefox-esr for instructions to add Firefox ESR to Cypress Docker images.

Closing this issue as it now duplicates the above issues and information.

MikeMcC399 avatar Aug 17 '24 11:08 MikeMcC399