Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from cypress-io:master #64

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,49 @@ export _MITSHM=0

See [issue #270](https://github.com/cypress-io/cypress-docker-images/issues/270)

## Firefox not found

By default, the containers run with the root user. However, Firefox by design cannot run with root user, leading to failures such as:

```
Browser: firefox was not found on your system or is not supported by Cypress.
Can't run because you've entered an invalid browser name.
```

To resolve this, the container needs to run with user id `1001`.

One example using the [cypress-io/github-action](https://github.com/cypress-io/github-action)

```yml
name: E2E in custom container
on: push
jobs:
cypress-run:
runs-on: ubuntu-22.04
container:
image: cypress/browsers:node18.12.0-chrome106-ff106
options: --user 1001
steps:
- uses: actions/checkout@v3
- uses: cypress-io/github-action@v5
with:
browser: firefox
```

Or within a Dockerfile

```Dockerfile
# Use Cypress base image
FROM cypress/browsers:node18.12.0-chrome106-ff106

# Change to a non-root user
USER 1001

#rest of your dockerfile here
```

The [GitHub Actions Runner](https://github.com/actions/runner) creates the `/github/home` (`$HOME`) directory with non-root ownership `1001` (`runner`). Specifying this same user allows Cypress to detect and run Firefox.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)
Expand Down
2 changes: 1 addition & 1 deletion factory/.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FACTORY_VERSION='3.0.0'
CHROME_VERSION='114.0.5735.133-1'

# Cypress versions: https://www.npmjs.com/package/cypress
CYPRESS_VERSION='12.17.3'
CYPRESS_VERSION='12.17.4'

# Edge versions: https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/
EDGE_VERSION='114.0.1823.51-1'
Expand Down
4 changes: 2 additions & 2 deletions included/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ $ docker run -it -v $PWD:/e2e -w /e2e -e DEBUG=cypress:* cypress/included:9.4.1
These images have its entry point set to `cypress run` without any additional arguments. You can specify additional Cypress CLI arguments after the image name. For example to print the Help menu for the `cypress run` command:

```shell
$ docker run -it --entrypoint=cypress cypress/included:9.4.1 --help
$ docker run -it --entrypoint=cypress cypress/included:9.4.1 run --help
```

To run a single spec using Chrome browser:

```shell
$ docker run -it --entrypoint=cypress cypress/included:9.4.1 --spec cypress/integration/spec-a.js --browser chrome
$ docker run -it --entrypoint=cypress cypress/included:9.4.1 run --spec cypress/integration/spec-a.js --browser chrome
```

## Entry
Expand Down