From dcd68303a43fd3080d51714bdd92614f649cf96b Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Fri, 16 Nov 2018 10:28:34 +0000 Subject: [PATCH] Docs: add installation details for Lambda without Docker --- docs/install.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/install.md b/docs/install.md index 2ca05d88..97bd0b52 100644 --- a/docs/install.md +++ b/docs/install.md @@ -149,16 +149,25 @@ docker pull tailor/docker-libvips ### AWS Lambda -A [deployment package](http://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html) for the -[Lambda Execution Environment](http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) -can be built using Docker. +Set the Lambda runtime to Node.js 8.10. + +The binaries in the `node_modules` directory of the +[deployment package](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html) +must be for the Linux x64 platform/architecture. + +On non-Linux machines such as OS X and Windows run the following: ```sh rm -rf node_modules/sharp -docker run -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 npm install +npm install --arch=x64 --platform=linux --target=8.10.0 sharp ``` -Set the Lambda runtime to Node.js 8.10. +Alternatively a Docker container closely matching the Lambda runtime can be used: + +```sh +rm -rf node_modules/sharp +docker run -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 npm install sharp +``` To get the best performance select the largest memory available. A 1536 MB function provides ~12x more CPU time than a 128 MB function.