Run aws lambda locally
Create simple Dockerfile
:
1 2 3 4 5 6 |
FROM lambci/lambda:build-nodejs12.x COPY . . RUN curl -o- -L https://yarnpkg.com/install.sh | bash RUN $HOME/.yarn/bin/yarn USER sbx_user1051 ENTRYPOINT ["/var/rapid/init", "--bootstrap", "/var/runtime/bootstrap", "--enable-msg-logs"] |
The above Dockerfile
is for nodejs lambdas, check https://github.com/lambci/docker-lambda for more docker images.
Build the above docker image:
1 |
$ docker build -t image-name . |
Run the docker image:
1 |
$ docker run --rm --env-file someenvfile.env -p 9001:9001 -v "$PWD":/var/task:ro,delegated image-name lambda.handle |
Reply