Native module installer for AWS Lambda + NodeJS
6.1K
This project allows users to easily install NodeJS modules, including those written as addons with gyp in C/C++ for AWS Lambda.
From your project directory:
docker run -v $PWD:/var/task iopipe/awslambda-npm-install <npm-path>
This will build C/C++ modules and install them into your node_modules directory using
the latest verison of NodeJS.
That's it!
Specify a Docker tag on the image name. Supported tags include:
The tag may be specified as in the following command:
docker run -v $PWD:/var/task iopipe/awslambda-npm-install:v4 <npm-path>
Build for NodeJS v4.3.2:
docker build --build_arg NODE_VERSION=4.3.2 -t awslambda-npm-install .
Build for NodeJS v6.10.2:
docker build --build_arg NODE_VERSION=6.10.2 -t awslambda-npm-install .
The following example will create a new Serverless Framework project and add the native protocol buffers module.
$ serverless create -t aws-nodejs
$ docker run -v $PWD:/var/task iopipe/awslambda-npm-install protobuf
$ cat <<EOF > handler.js
var protobuf = require('protobuf')
module.exports.hello = (event, context, callback) => {
callback()
}
EOF
$ serverless deploy
This image is built on AWS Linux and builds its own versions of NodeJS based on the versions used by AWS. None of these files have been copied from the AWS Lambda environment, but are publicly and legally available sources and binaries provided by AWS and the NodeJS foundation for public and open use.
Apache-2.0 see LICENSE
Copyright 2017 IOpipe, Inc.
Content type
Image
Digest
Size
359.2 MB
Last updated
over 8 years ago
docker pull iopipe/awslambda-npm-install