Jenkins does not have permissions to write to its home folder which is required by yarn

Viewed 465

I’m using Jenkins in a VM on Google’s cloud platform. This is the first time I’ve used a CI tool, Docker, and gcloud.

In my pipeline as part of the build process, Jenkins runs yarn install which immediately fails with "EACCES: permission denied, mkdir '/.config'"

Also as part of build composer install is run and I noticed that it also cannot create its cache directory usually located within the users home folder.

Stuff I’ve tried (I know some of this is not advisable)

I’ve tried:

chown and chmod (777) on the home folder to the Jenkins user.

whoami in the pipeline returns unknown UID 109 so I tried chmod/own to that user too

Tried adding Jenkins user to sudoers for ALL

Tried changing Jenkins config in defaults to run as root user instead of Jenkins.

0 Answers
Related