cypress-docker-images icon indicating copy to clipboard operation
cypress-docker-images copied to clipboard

cypress docker image root user misconfiguration

Open ViliusS opened this issue 2 years ago • 11 comments

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.

ViliusS avatar Jul 12 '23 21:07 ViliusS

@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 avatar Jul 14 '23 13:07 MikeMcC399

Closing due to inactivity.

MikeMcC399 avatar May 24 '24 06:05 MikeMcC399

@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.

ViliusS avatar May 28 '24 07:05 ViliusS

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

MikeMcC399 avatar May 28 '24 08:05 MikeMcC399

The Cypress binary installs in /root

https://github.com/cypress-io/cypress-docker-images/blob/55c80b6bd6a64213f5544da91fc50dd966834075/factory/factory.Dockerfile#L24

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

https://github.com/cypress-io/cypress-docker-images/blob/55c80b6bd6a64213f5544da91fc50dd966834075/factory/factory.Dockerfile#L111-L113

MikeMcC399 avatar Jun 06 '24 12:06 MikeMcC399