Skip to content

Commit 0cdff72

Browse files
committed
Add syntax highlighting in Readme and fix a couple typos
Typos: - Add missing "\" at line end - Remove stray "`" at line end
1 parent 6c827ea commit 0cdff72

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
7979

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

82-
```
82+
```sh
8383
#!/bin/sh
8484
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
8585
exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric
@@ -93,28 +93,24 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
9393
3. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile:
9494

9595
To use the default x86\_64 architecture
96-
97-
```
96+
```dockerfile
9897
ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
9998
ENTRYPOINT [ "/entry_script.sh" ]
10099
```
101100

102101
To use the arm64 architecture:
103-
104-
```
102+
```dockerfile
105103
ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie
106104
ENTRYPOINT [ "/entry_script.sh" ]
107105
```
108106

109107
4. Build your image locally using the docker build command.
110-
111-
```
108+
```sh
112109
docker build -t myfunction:latest .
113110
```
114111

115112
5. Run your image locally using the docker run command.
116-
117-
```
113+
```sh
118114
docker run -p 9000:8080 myfunction:latest
119115
```
120116

@@ -125,7 +121,7 @@ You install the runtime interface emulator to your local machine. When you run t
125121

126122
1. From your project directory, run the following command to download the RIE (x86-64 architecture) from GitHub and install it on your local machine.
127123

128-
```
124+
```sh
129125
mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \
130126
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
131127
&& chmod +x ~/.aws-lambda-rie/aws-lambda-rie
@@ -138,17 +134,18 @@ You install the runtime interface emulator to your local machine. When you run t
138134
```
139135

140136
2. Run your Lambda image function using the docker run command.
141-
142-
```
143-
docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest
144-
--entrypoint /aws-lambda/aws-lambda-rie <image entrypoint> <(optional) image command>`
137+
```sh
138+
docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest \
139+
--entrypoint /aws-lambda/aws-lambda-rie <image entrypoint> <(optional) image command>
145140
```
146141

147142
This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`.
148143

149144
3. Post an event to the following endpoint using a curl command:
150145

151-
`curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'`
146+
```sh
147+
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
148+
```
152149

153150
This command invokes the function running in the container image and returns a response.
154151

0 commit comments

Comments
 (0)