You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,20 @@
1
1
# python-lambda-docker
2
-
Lightweight docker image for running and packaging python-based AWS lambda code. This is based on [nficano](https://github.com/nficano/)'s super useful [python-lambda library](https://github.com/nficano/python-lambda/)
3
2
4
-
*[alpine-aws-python-lambda on docker hub](https://hub.docker.com/r/kilna/alpine-aws-python-lambda/)
5
-
*[alpine-aws-python-lambda on github](https://github.com/kilna/alpine-aws-python-lambda)
3
+
Lightweight docker image for running and packaging python-based AWS lambda code
* Based on the [python-lambda library](https://github.com/nficano/python-lambda/) by [nficano](https://github.com/nficano/)
10
+
11
+
## Purpose
8
12
9
13
I needed a Docker-based environment in which to host AWS python lambda functions for the purpose of testing and building them... python-lambda works well under virtualenv for development, but build and deployment automation require a clean and reproducible environment to operate in. Our CI system already supported Docker as a containerization sytem, so it was the obvious choice.
10
14
11
15
In order to use this, you will have your project derive its own Dockerfile based on a base python-lambda image corresponding to which version of Python you wish to run.
12
16
13
-
# Usage
17
+
##Usage
14
18
15
19
An example of a usable project can be found in the [example/](./example/) directory. This lambda function takes a JSON input file like the provided [event.json](./example/event.json) and returns an ASCII-art version of the text described in it. The provided [Dockerfile](./example/Dockerfile) derives from this image and loads the current workspace into the image, then installs dependencies from the [requirements.txt](./example/requirements.txt) file.
16
20
@@ -38,7 +42,7 @@ If you would like to see if your lambda function builds properly, run:
38
42
$ docker run example-lambda-image lambda build
39
43
```
40
44
41
-
## Build and Test
45
+
###Build and Test
42
46
43
47
If you would like to build and test the lambda function and gather up the results, you can run:
44
48
@@ -58,7 +62,7 @@ Behind the scenes, what this script does is:
58
62
* Tars the log files, and the contents of the dist directory in /lambda on the container and pipes it to standard output
59
63
* Untars the contents bundled up within the container, and extracts them into your current directory
60
64
61
-
## Python Version
65
+
###Python Version
62
66
63
67
The example Dockerfile uses _:latest_ in the FROM line, which is currently the same as _:python-3.6_, but if you wish to use different python versions you can change this.
0 commit comments