An open API service indexing awesome lists of open source software.

https://github.com/iwitaly/aws-lambda-docker-builder

Docker image for building packages for AWS Lambda with Python environment
https://github.com/iwitaly/aws-lambda-docker-builder

aws aws-lambda docker docker-image numpy python python3

Last synced: about 1 month ago
JSON representation

Docker image for building packages for AWS Lambda with Python environment

Awesome Lists containing this project

README

          

# Description

Sometimes when you upload Python binary packages to AWS Lambda from your local machine, you get an error. For example, if you want to use *numpy* with AWS Lambda you need a built version on AWS Linux.

Setting up AWS instance just for a build is a pain. That's why you can quickly [install Docker](https://docs.docker.com/installation/) and build any package on your machine. After building a package just copy into your ``` vendored/ ``` folder and upload to Lambda.

# Usage

If you're ok with Python 3, simply build Docker image from a given ``` Dockerfile ``` with a command

```
docker build -t your_name/your_tag .
```

Don't forget to replace *your_name* and *your_tag* to whatever you want.

Then run your container and mount local folder with a desired ``` requirements.txt ``` file to a containers ```/workdir_container``` with a command

```
docker run --rm -v your_folder_with_requirements_file:/workdir_container your_name/your_tag
```

Now wait for packages to be built and find them at ```your_folder_with_requirements_file/vendored/```.