cypress-io / cypress-docker-images

Docker images with Cypress dependencies and browsers
https://on.cypress.io/continuous-integration
MIT License
1.01k stars 376 forks source link

Outdated legacy examples/included-as-non-root #1084

Closed MikeMcC399 closed 4 weeks ago

MikeMcC399 commented 1 month ago

Situation

The README in examples/included-as-non-root states than if cypress/included is run as a non-root user, Cypress will not be able to access the cached Cypress binary.

It suggests as a solution to build a new image based on cypress/included which moves the cached Cypress binary to the non-root user's home directory.

Tests

Legacy Cypress

cypress/included:3.8.0

The example is set up to use cypress/included:3.8.0. With the non-root user node it can be confirmed that Cypress is unable to access the cached Cypress binary.

cd examples/included-as-non-root
docker run -it -v $PWD/src:/test -w /test -u node cypress/included:3.8.0
The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /home/node/.cache/Cypress/3.8.0/Cypress/Cypress

Current Cypress

After updating the Cypress project in examples/included-as-non-root/src by migrating to Cypress 13.0, the test project runs without needing to build a new image.

docker run -it -v $PWD/src:/test -w /test -u node cypress/included:13.10.0

Conclusion

The issue of access to the cached Cypress binary in cypress/included, which the example explains and provides a resolution for, is no longer an issue using the current cypress/included:13.10.0 image.

Suggestion

Migrate the example examples/included-as-non-root to Cypress 13.x, explaining that this is no longer an issue.

MikeMcC399 commented 4 weeks ago