@@ -7,28 +7,32 @@ This is based on the super useful python-lambda library:
77
88# Usage
99
10- An example of a usable project can be found in the < example /> directory. This example lambda function
10+ An example of a usable project can be found in the ` example/ ` directory. This example lambda function
1111takes a JSON input file like event.json and returns an ASCII-art version of the text.
1212
13- ``` $ cd example/
13+ ```
14+ $ cd example/
1415```
1516
1617The Dockerfile in the example directory loads the current workspace into the image and installs
1718dependencies from the requirements.txt file:
1819
19- ``` FROM kilna/alpine-aws-python-lambda
20+ ```
21+ FROM kilna/alpine-aws-python-lambda
2022COPY . /workspace
2123RUN pip install -r requirements.txt
2224```
2325
2426To build a docker image called 'example-lambda-image' with the lambda function in it, run:
2527
26- ``` $ docker build --tag example-lambda-image .
28+ ```
29+ $ docker build --tag example-lambda-image .
2730```
2831
2932If you want to execute the lambda function against an event.json input file:
3033
31- ``` $ docker run example-lambda-image lambda invoke
34+ ```
35+ $ docker run example-lambda-image lambda invoke
3236 _ _ _ _ _ _ _
3337 | || | ___ | | | | ___ __ __ __ ___ _ _ | | __| | | |
3438 | __ | / -_) | | | | / _ \ _ \ V V / / _ \ | '_| | | / _` | |_|
@@ -39,13 +43,13 @@ If you want to execute the lambda function against an event.json input file:
3943
4044If you would like to see if your lambda function builds properly, run:
4145
42- ``` $ docker run example-lambda-image lambda build
46+ ```
47+ $ docker run example-lambda-image lambda build
4348```
4449
4550If you would like to get a ZIP file of the lambda function suitable for uploading to Amazon:
4651
47- ``` $ docker run example-lambda-image sh -c 'rm -rf dist* && lambda build 2&>1 >/dev/null && tar -c dist/*.zip' | tar -x -v
52+ ```
53+ $ docker run example-lambda-image sh -c 'rm -rf dist* && lambda build 2&>1 >/dev/null && tar -c dist/*.zip' | tar -x -v
4854dist/2017-08-31-212523-example-lambda.zip
4955```
50-
51-
0 commit comments