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

cypress docker image root user misconfiguration #914

Open
ViliusS opened this issue Jul 12, 2023 · 5 comments
Open

cypress docker image root user misconfiguration #914

ViliusS opened this issue Jul 12, 2023 · 5 comments

Comments

@ViliusS
Copy link

ViliusS commented Jul 12, 2023

We tried to run cypress docker image under Jenkins which runs all docker images with non-root account. Unfortunately, this is not possible without hack and modifications in the image itself.

I've investigated this a bit and it seems that the source of this issue is that cypress is installed under /root folder by default. This is misconfiguration because /root folder is not designed to host global libraries or software. It translated then to all sorts of problems, like libraries not resolving, difficulties to run images under SaaS CI providers, etc.

My proposal is to have cypress installed into /usr/local or whatever is provided by default npm configuration under used OS.

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Jul 14, 2023

@ViliusS

There are Jenkins examples listed in the table:

cypress-io/cypress-example-kitchensink > CI Workflow Examples

The Jenkins examples use cypress/base Docker images.

Which type of Docker images were you having problems with (base/browsers/included)?

If you were not using cypress/base perhaps you would like to try that out.

@MikeMcC399
Copy link
Collaborator

Closing due to inactivity.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
@ViliusS
Copy link
Author

ViliusS commented May 28, 2024

@MikeMcC399 sorry, I've totally missed your previous question. We were actually using cypress/factory image. We could in theory probably use base but we really don't want to take care of installing cypress ourselves. IMHO cypress (or any software for that matter) should not be installed into /root by default, be it custom or official image.

@MikeMcC399 MikeMcC399 reopened this May 28, 2024
@MikeMcC399
Copy link
Collaborator

Thanks for your feedback and I have re-opened your issue.

@MikeMcC399
Copy link
Collaborator

The Cypress binary installs in /root

CYPRESS_CACHE_FOLDER=/root/.cache/Cypress

The Cypress npm module installs in /usr/local/lib/node_modules which is standard for npm global installation.

# Allow projects to reference globally installed cypress
# This is only set if the cypress version is passed in (thats what the + syntax stuff does.)
ONBUILD ENV NODE_PATH=${CYPRESS_VERSION:+/usr/local/lib/node_modules}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants