Skip to content

Commit

Permalink
docs: rework docker example (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcC399 authored Aug 15, 2023
1 parent bd079a6 commit 05a8962
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,32 @@ jobs:

### Docker image

You can run tests in a GH Action in your Docker container.
You can run the action in a Docker container.

```yml
name: E2E in custom container
name: Test in Docker
on: push
jobs:
cypress-run:
runs-on: ubuntu-22.04
# Cypress Docker image with Chrome v106
# and Firefox v106 pre-installed
container: cypress/browsers:node18.12.0-chrome106-ff106
# Cypress Docker image from https://hub.docker.com/r/cypress
# with browsers pre-installed
container:
image: cypress/browsers:latest
options: --user 1001
steps:
- uses: actions/checkout@v3
- uses: cypress-io/github-action@v5
with:
browser: chrome
```

Replace the `latest` tag with a specific version image tag from [`cypress/browsers` on Docker Hub](https://hub.docker.com/r/cypress/browsers/tags) to avoid breaking changes when new images are released (especially when they include new major versions of Node.js).

Include `options: --user 1001` to avoid permissions issues.

Refer to [cypress-io/cypress-docker-images](https://github.com/cypress-io/cypress-docker-images) for further information about using Cypress Docker images. Cypress offers the [Cypress Docker Factory](https://github.com/cypress-io/cypress-docker-images/tree/master/factory) to generate additional Docker images with selected components and versions.

### Env

Specify the env argument with `env` parameter
Expand Down

0 comments on commit 05a8962

Please sign in to comment.