Skip to content

docs: corrected bullet point's content spacing/indentation #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ You can build RIE into a base image. Download the RIE from GitHub to your local

1. Create a script and save it in your project directory. Set execution permissions for the script file.

The script checks for the presence of the `AWS_LAMBDA_RUNTIME_API` environment variable, which 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.
The script checks for the presence of the `AWS_LAMBDA_RUNTIME_API` environment variable, which 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.

The following example shows a typical script for a Node.js function.

The following example shows a typical script for a Node.js function.
```
#!/bin/sh
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
Expand All @@ -75,24 +76,28 @@ The following example shows a typical script for a Node.js function.

3. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile:

To use the default x86\_64 architecture
To use the default x86\_64 architecture

```
ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
ENTRYPOINT [ "/entry_script.sh" ]
```

To use the arm64 architecture:
To use the arm64 architecture:

```
ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie
ENTRYPOINT [ "/entry_script.sh" ]
```

4. Build your image locally using the docker build command.

```
docker build -t myfunction:latest .
```

5. Run your image locally using the docker run command.

```
docker run -p 9000:8080 myfunction:latest
```
Expand All @@ -110,12 +115,14 @@ You install the runtime interface emulator to your local machine. When you run t
&& chmod +x ~/.aws-lambda-rie/aws-lambda-rie
```

To download the RIE for arm64 architecture, use the previous command with a different GitHub download url.
To download the RIE for arm64 architecture, use the previous command with a different GitHub download url.

```
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 \
```

2. Run your Lambda image function using the docker run command.

```
docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest
--entrypoint /aws-lambda/aws-lambda-rie <image entrypoint> <(optional) image command>`
Expand Down