From 0519d23473d722b2a66a9dd5bfddf71c74e5a7b4 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:03:52 +0200 Subject: [PATCH] docs: rework docker example --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 235f5b64e..ec7cc8978 100644 --- a/README.md +++ b/README.md @@ -213,17 +213,19 @@ 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 @@ -231,6 +233,12 @@ jobs: 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