@@ -79,7 +79,7 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
79
79
80
80
The following example shows a typical script for a Node.js function.
81
81
82
- ```
82
+ ``` sh
83
83
#! /bin/sh
84
84
if [ -z " ${AWS_LAMBDA_RUNTIME_API} " ]; then
85
85
exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric
@@ -94,27 +94,27 @@ You can build RIE into a base image. Download the RIE from GitHub to your local
94
94
95
95
To use the default x86\_ 64 architecture
96
96
97
- ```
97
+ ` ` ` dockerfile
98
98
ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
99
99
ENTRYPOINT [ " /entry_script.sh" ]
100
100
` ` `
101
101
102
102
To use the arm64 architecture:
103
103
104
- ```
104
+ ` ` ` dockerfile
105
105
ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie
106
106
ENTRYPOINT [ " /entry_script.sh" ]
107
107
` ` `
108
108
109
109
4. Build your image locally using the docker build command.
110
110
111
- ```
111
+ ` ` ` sh
112
112
docker build -t myfunction:latest .
113
113
` ` `
114
114
115
115
5. Run your image locally using the docker run command.
116
116
117
- ```
117
+ ` ` ` sh
118
118
docker run -p 9000:8080 myfunction:latest
119
119
` ` `
120
120
@@ -126,7 +126,7 @@ You install the runtime interface emulator to your local machine. When you run t
126
126
127
127
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.
128
128
129
- ```
129
+ ` ` ` sh
130
130
mkdir -p ~ /.aws-lambda-rie && curl -Lo ~ /.aws-lambda-rie/aws-lambda-rie \
131
131
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
132
132
&& chmod +x ~ /.aws-lambda-rie/aws-lambda-rie
@@ -140,7 +140,7 @@ You install the runtime interface emulator to your local machine. When you run t
140
140
141
141
2. Run your Lambda image function using the docker run command.
142
142
143
- ```
143
+ ` ` ` sh
144
144
docker run -d -v ~ /.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest \
145
145
--entrypoint /aws-lambda/aws-lambda-rie < image entrypoint> <( optional) image command>
146
146
` ` `
@@ -149,7 +149,7 @@ You install the runtime interface emulator to your local machine. When you run t
149
149
150
150
3. Post an event to the following endpoint using a curl command:
151
151
152
- ```
152
+ ` ` ` sh
153
153
curl -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {}'
154
154
` ` `
155
155
0 commit comments