aws-layer-pypacker is a tool to create AWS Lambda Layers from Python3.7 packages with aws linux docker image that is compatible to any OS.
Build the docker image with
docker build -t layer-packer:latest .
Build the docker image with
docker build -t layer-packer:latest . --platform linux/amd64
To build a new python3.7 package layer:
- Create a required package text file named
{layer_name}.txt
- Place the text file in
requirements
folder - Run the docker image with:
docker run -v "$(pwd)/requirements:/requirements" -v "$(pwd)/layers:/layers" -e LAYER_NAME={layer_name} --rm layer-packer:latest
- The generated zip file will be placed in
/layers
with naming of{layer_name}.zip