alternate install instructions for AWS Lambda
See original GitHub issueInstead of spinning up an EC2 instances, I used the Amazon Linux docker image locally
docker run -it amazonlinux:latest /bin/bash
Then on the docker image at the bash-4.2#
prompt:
curl -sL https://rpm.nodesource.com/setup_6.x | bash -
yum install -y gcc-c++ nodejs-6.10.3
mkdir /var/task && cd /var/task
npm install sharp
Back on the host (in a separate terminal window), I copied node_modules to my project directory. (182008de1f47 is the CONTAINER ID from docker ps
):
docker cp 182008de1f47:/var/task/node_modules .
Maybe these could be alternate install instructions in the AWS Lambda section of docs/install.md
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Best practices for working with AWS Lambda functions
See Deploy Java Lambda functions with .zip or JAR file archives for instructions. Minimize the complexity of your dependencies.
Read more >AWS Lambda – FAQs
Q: What is AWS Lambda? AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time...
Read more >Lambda extensions - AWS Documentation
Learn how to use extensions with your AWS Lambda function. ... run as separate processes, you can write them in a different language...
Read more >Getting started with Lambda - AWS Documentation
To get started with Lambda, use the Lambda console to create a function. In a few minutes, you can create a function, invoke...
Read more >Lambda runtimes - AWS Documentation
To change the runtime, you can update your function's configuration. The runtime is paired with one of the Amazon Linux distributions. The underlying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, https://github.com/awslabs/aws-sam-local even uses that docker-lambda image. It is on my list to look at as well.
I am having some issue with this while using typescript and webpack. I do the docker-npm install, and that seems to do it’s thing, but I still get this issue when deploying to AWS lambda.
It says;
[684] external "sharp" 42 bytes {0} [built]
andServerless: Packing external modules: sharp@^0.20.5
.Perhaps serverless-webpack is changing the binary somehow?