Skip to content

Commit 5dd9524

Browse files
Updated README to explain the two images
1 parent 3117fb8 commit 5dd9524

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ module may not be compatible with the Amazon Lambda execution environment.
88
A common solution to this problem is to build the package on an EC2 instance using an Amazon Linux AMI and then to
99
deploy it in Amazon Lambda. Building serverless applications, it is ironic to be obliged to use an EC2 server to deploy code.
1010

11-
This docker image is based on the [Amazon Linux 1](https://hub.docker.com/_/amazonlinux/) image and contains `gcc`,
12-
`python 2.7`, `python 3.6`, `python 3.7`, `pip`, `node 6.10`, `node 8.10` to create packages for Amazon Lambda.
11+
This docker image is based on the [Amazon Linux](https://hub.docker.com/_/amazonlinux/) image and contains `gcc`.
1312

14-
Using the docker image `myrmex/lambda-packager`, you can avoid errors like these during execution in Amazon Lambda:
13+
The AWS lambda [runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) are now split between `Amazon Linux` and `Amazon Linux 2` execution environments.
14+
15+
The docker image for `Amazon Linux` now contains `python 2.7`, `python 3.6`, `python 3.7`, `pip`, `node 6.10`, `node 8.10` to create packages for Amazon Lambda.
16+
17+
The docker image for `Amazon Linux 2` now contains `node 10.15` to create packages for Amazon Lambda.
18+
19+
Using the docker images from `myrmex/lambda-packager`, you can avoid errors like these during execution in Amazon Lambda:
1520

1621
```
1722
/var/lang/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/task/node_modules/bcrypt/lib/binding/bcrypt_lib.node)
@@ -21,6 +26,24 @@ Using the docker image `myrmex/lambda-packager`, you can avoid errors like these
2126
Module version mismatch. Expected 46, got 48.
2227
```
2328

29+
## Building
30+
31+
To build the required images standard `Dockerfile` have been included one for `Amazon Linux` and another for `Amazon Linux 2`.
32+
33+
To build the `Amazon Linux` image that supports node 6.10, node 8.10, python 2.7, python 3.6 and python 3.7
34+
35+
```bash
36+
cd Amazon\ Linux
37+
docker build -t myrmex/lambda-packager .
38+
```
39+
40+
To build the `Amazon Linux 2` image that supports node 10.15
41+
42+
```bash
43+
cd Amazon\ Linux\ 2
44+
docker build -t myrmex/lambda-packager:amazonlinux2 .
45+
```
46+
2447
## Usage
2548

2649
You can use a docker volume to mount the code of the Lambda in a container. The directory where `npm install` or
@@ -51,10 +74,21 @@ docker run -e HOST_UID=`id -u` -e HOST_GID=`id -g` -v `pwd`:/data myrmex/lambda-
5174

5275
The `RUNTIME` environment variable allows to choose the runtime.
5376

77+
### Node 10.15
78+
79+
Node 10.15 is the default runtime for `Amazon Linux 2` and does not require any special configuration.
80+
81+
```bash
82+
docker run -v `pwd`:/data myrmex/lambda-packager:amazonlinux2
83+
```
5484

5585
#### Node 8.10
5686

57-
Node 8.10 is the default runtime and does not require any special configuration.
87+
Node 8.10 is the default runtime for `Amazon Linux` and does not require any special configuration.
88+
89+
```bash
90+
docker run -v `pwd`:/data myrmex/lambda-packager
91+
```
5892

5993
#### Node 6.10
6094

0 commit comments

Comments
 (0)