Search code examples
dockercypress

Cypress Docker: Chrome was not found on your system


I'm trying to run my Cypress tests in a docker container locally but I keep having an issue when trying to run in Chrome, the command I'm running is:

docker run -it -v $PWD:/e2e -w /e2e cypress/included:10.3.1 --browser chrome

According to https://github.com/cypress-io/cypress-docker-images/tree/master/included it should have chrome, firefox and edge but I'm getting:

Can't run because you've entered an invalid browser name.

Browser: chrome was not found on your system or is not supported by Cypress.

Cypress supports the following browsers:

  • electron
  • chrome
  • chromium
  • chrome:canary
  • edge
  • firefox

You can also use a custom browser: https://on.cypress.io/customize-browsers

Available browsers found on your system are:

  • electron

Locally I do have Chrome and Firefox installed. I'm able to run the tests through docker using Electron fine, but I'm trying to run a lighthouse test which requires running on Chrome.

Am I doing something wrong? I've tried another few cypress/included v 10 images but haven't had any luck. I'm running on a Macbook if that makes any difference.

If I don't use docker and just open Cypress I'm able to run on Chrome fine.


Solution

  • If your processor architecture is arm64 the cypress/browser docker image does not contain any browsers.

    The reason is following line in the Dockerfile:

    RUN node -p "process.arch === 'arm64' ? 'Not downloading Chrome since we are on arm64: https://crbug.com/677140' : process.exit(1)" || 
    

    Cypress has already commented on this and asks to support this architecture. See here: https://bugs.chromium.org/p/chromium/issues/detail?id=677140#c19