Skip to content

Commit 68b32d6

Browse files
authored
chore: fix poorly formatted README.md section (aws#18)
1 parent 6a74e68 commit 68b32d6

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,32 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
5757
#### To build the emulator into your image
5858

5959
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.
60+
```
61+
#!/bin/sh
62+
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
63+
exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric
64+
else
65+
exec /usr/bin/npx aws-lambda-ric
66+
fi
67+
```
68+
69+
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.
6070
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+
```
6876
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+
```
7081
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+
```
7386
7487
### Test an image without adding RIE to the image
7588
@@ -110,7 +123,7 @@ You can configure timeout by setting AWS_LAMBDA_FUNCTION_TIMEOUT to the number o
110123

111124
The rest of these Environment Variables can be set to match AWS Lambda's environment but are not required.
112125
* `AWS_LAMBDA_FUNCTION_VERSION`
113-
* `AWS_LAMBDA_FUNCION_NAME`
126+
* `AWS_LAMBDA_FUNCTION_NAME`
114127
* `AWS_LAMBDA_MEMORY_SIZE`
115128

116129
## Level of support

0 commit comments

Comments
 (0)