You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
examples/included-as-non-root-alternative demonstrates how to build a new Docker image on top of cypress/included, giving all users read access to the /root directory and setting CYPRESS_CACHE_FOLDER=/root/.cache/Cypress.
Tests
Legacy Cypress
cypress/included:3.8.0
The example builds a new Docker image based on cypress/included:3.8.0.
cd examples/included-as-non-root-alternative
./build.sh
./test.sh
Under Docker Desktop for Linux, the new Docker image is successfully built, however it fails to run, outputting the error:
docker run -it -v $PWD/src:/test -w /test -u node cypress/included:13.10.0
When running under Docker Desktop for Linux, Cypress completes the test successfully and warns that the test directory is not writable and so it cannot save videos or screenshots. This is however a separate topic. For file sharing in this environment see FAQs for Docker Desktop for Linux.
# point Cypress at the /root/cache no matter what user account is used
# see https://on.cypress.io/caching
CYPRESS_CACHE_FOLDER=/root/.cache/Cypress
Node.js 18.x is the lowest version still supported and all related images cypress/included:*-node-18* were generated based on the cypress/factory process. This means that they all have the fixed permissions settings.
Situation
examples/included-as-non-root-alternative demonstrates how to build a new Docker image on top of
cypress/included
, giving all users read access to the/root
directory and settingCYPRESS_CACHE_FOLDER=/root/.cache/Cypress
.Tests
Legacy Cypress
cypress/included:3.8.0
The example builds a new Docker image based on
cypress/included:3.8.0
.cd examples/included-as-non-root-alternative ./build.sh ./test.sh
Under Docker Desktop for Linux, the new Docker image is successfully built, however it fails to run, outputting the error:
Current Cypress
After updating the Cypress project in examples/included-as-non-root-alternative/src by migrating to Cypress 13.0, modifying the Dockerfile to build from
cypress/included:13.10.0
and removing the check onbinary_state.json
, the test project runs.docker run -it -v $PWD/src:/test -w /test -u node cypress/included:13.10.0
When running under Docker Desktop for Linux, Cypress completes the test successfully and warns that the
test
directory is not writable and so it cannot save videos or screenshots. This is however a separate topic. For file sharing in this environment see FAQs for Docker Desktop for Linux.Conclusion
examples/included-as-non-root-alternative is redundant because all currently generated images based on factory/factory.Dockerfile already contain the steps described in the example:
cypress-docker-images/factory/factory.Dockerfile
Lines 29 to 30 in e822509
cypress-docker-images/factory/factory.Dockerfile
Lines 22 to 24 in e822509
Node.js
18.x
is the lowest version still supported and all related imagescypress/included:*-node-18*
were generated based on thecypress/factory
process. This means that they all have the fixed permissions settings.Suggestion
Remove the examples/included-as-non-root-alternative and references to it, as it is now redundant.
The text was updated successfully, but these errors were encountered: