Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow use of docker container for npm install#251

Merged
DeviaVir merged 9 commits intomotdotla:mastermotdotla/node-lambda:masterfrom
swhite24:feature/dockerswhite24/node-lambda:feature/dockerCopy head branch name to clipboard
May 1, 2017
Merged

Allow use of docker container for npm install#251
DeviaVir merged 9 commits intomotdotla:mastermotdotla/node-lambda:masterfrom
swhite24:feature/dockerswhite24/node-lambda:feature/dockerCopy head branch name to clipboard

Conversation

@swhite24
Copy link
Contributor

@swhite24 swhite24 commented Apr 27, 2017

Related to #168
This PR does a couple of things:

  1. Allow a docker image (-I, --dockerImage) to be provided to either the package or deploy command. This image will then be used as the environment in which npm install will be run. An example of the type of image you'd want to use is https://github.com/lambci/docker-lambda .
    There is also an assumption made that the image matches the lambda environment, such as mounting the code directory to and setting the working directory to /var/task.
  2. Changes the code directory to $PWD/.lambda. On a mac, os.tmpDir() resolves to a symlink, which are notoriously difficult to work with when mounting volumes inside a docker container. Changing the code directory seemed like a simple approach to alleviate those concerns, though I realize this is a somewhat inconvenient change.

Example usage:

node-lambda package -I alchemy/lambda:build -A pkg --handler dist/handler.handler  --functionName foo

@DeviaVir DeviaVir self-requested a review May 1, 2017 08:59
Copy link
Collaborator

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, and seems like a really clever idea. Thanks for contributing! 👍

@DeviaVir DeviaVir merged commit 6303580 into motdotla:master May 1, 2017
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.