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

fix(lambda-nodejs): permission denied on npm cache #9167

Merged
merged 1 commit into from
Jul 20, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented Jul 20, 2020

The npm cache was owned by the user 1000 so if the image was run by
a user other than 1000 installing via npm (when using the nodeModules
prop) resulted in a EACCES error on the cache folder. Yarn automatically
falls back to /tmp in this case.

Move npm cache folder creation to the end of the Dockerfile so that no
root content has been created in it when the image starts. Set cache
folder permission to 777.

Also disable npm update notification and add tests for the Dockerfile.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

The npm cache was owned by the user 1000 so if the image was run by
a user other than 1000 installing via npm resulted in a `EACCES` error
on the cache folder. Yarn automatically falls back to `/tmp` in this
case.

Move npm cache folder creation to the end of the Dockerfile so that no
root content has been created in it when the image starts. Set cache
folder permission to 777.

Also disable npm update notification and add tests for the Dockerfile.
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 9edb181
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jul 20, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4327843 into aws:master Jul 20, 2020
Chriscbr pushed a commit to Chriscbr/aws-cdk that referenced this pull request Jul 23, 2020
The npm cache was owned by the user 1000 so if the image was run by
a user other than 1000 installing via npm (when using the `nodeModules`
prop) resulted in a `EACCES` error on the cache folder. Yarn automatically
falls back to `/tmp` in this case.

Move npm cache folder creation to the end of the Dockerfile so that no
root content has been created in it when the image starts. Set cache
folder permission to 777.

Also disable npm update notification and add tests for the Dockerfile.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this pull request Aug 11, 2020
The npm cache was owned by the user 1000 so if the image was run by
a user other than 1000 installing via npm (when using the `nodeModules`
prop) resulted in a `EACCES` error on the cache folder. Yarn automatically
falls back to `/tmp` in this case.

Move npm cache folder creation to the end of the Dockerfile so that no
root content has been created in it when the image starts. Set cache
folder permission to 777.

Also disable npm update notification and add tests for the Dockerfile.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@jogold jogold deleted the lambda-nodejs-npm-cache branch August 17, 2020 07:50
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