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

jenkins: fix npm build, removing docker -u #23

Merged
merged 1 commit into from
Nov 11, 2018

Conversation

aledsage
Copy link
Contributor

@aledsage aledsage commented Oct 1, 2018

npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting -u for now.

e.g. https://builds.apache.org/view/B/view/Brooklyn/job/brooklyn-master-build-docker-pipeline/10/console failed with:

[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ brooklyn-ui-utils ---
[INFO] Running 'npm install' in /home/jenkins/jenkins-slave/workspace/brooklyn-master-build-docker-pipeline/brooklyn-ui/ui-modules/utils
[ERROR] Unhandled rejection Error: EACCES: permission denied, mkdir '/.npm'

This stackoverflow looks useful for fixing it longer term: https://stackoverflow.com/questions/46129443/sudo-permission-inside-docker-container-for-jenkins-pipeline.

We could npm config set cache /tmp and also export HOME=....

Or we could create a user with id 910:910 in the container, as part of the Dockerfile.

npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting `-u` for now.
@asfgit asfgit merged commit 18d07ee into apache:master Nov 11, 2018
asfgit pushed a commit that referenced this pull request Nov 11, 2018
@kemitix
Copy link
Contributor

kemitix commented Nov 12, 2018

Couldn't we mount a volume as /.npm and $HOME? I thought that was the intention behind docker having the -u option.

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

Successfully merging this pull request may close these issues.

3 participants