You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-11Lines changed: 24 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,19 +57,32 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
57
57
#### To build the emulator into your image
58
58
59
59
1. Create a script and save it in your project directory. The following example shows a typical script for a Node.js function. The presence of the AWS_LAMBDA_RUNTIME_API environment variable indicates the presence of the runtime API. If the runtime API is present, the script runs the runtime interface client (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-images.html#runtimes-api-client). Otherwise, the script runs the runtime interface emulator.
2. Download the runtime interface emulator (https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory.
60
70
61
-
*`#!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ricelseexec /usr/bin/npx aws-lambda-ricfi`
62
-
* Download the runtime interface emulator (https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory.
63
-
* Install the emulator package and change ENTRYPOINT to run the new script by adding the following lines to your Dockerfile:
64
-
```
65
-
ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
66
-
ENTRYPOINT [ “/entry_script.sh” ]
67
-
```
71
+
3. Install the emulator package and change ENTRYPOINT to run the new script by adding the following lines to your Dockerfile:
72
+
```
73
+
ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
74
+
ENTRYPOINT [ "/entry_script.sh" ]
75
+
```
68
76
69
-
2. Build your image locally using the docker build command.
77
+
4. Build your image locally using the docker build command.
78
+
```
79
+
docker build -t myfunction:latest .
80
+
```
70
81
71
-
`docker build -t myfunction:latest .`
72
-
`docker run -p 9000:8080 myfunction:latest`
82
+
5. Run your image locally using the docker run command.
83
+
```
84
+
docker run -p 9000:8080 myfunction:latest
85
+
```
73
86
74
87
### Test an image without adding RIE to the image
75
88
@@ -110,7 +123,7 @@ You can configure timeout by setting AWS_LAMBDA_FUNCTION_TIMEOUT to the number o
110
123
111
124
The rest of these Environment Variables can be set to match AWS Lambda's environment but are not required.
0 commit comments