Build container for AWS Lambda with python dependencies (rasterio & GDAL)

We’ve exceeded our 250 MB limit for the AWS Lambda. We’re looking at building a container. We have various python dependencies including rasterio that depends on GDAL. This is my work so far:

I’m curious if anyone else has been successful in building a container for AWS Lambda’s that includes GDAL or other dependencies that fail to pip install in the public.ecr.aws/lambda/python:3.10 container?

My next step is to explore how serverless-python-requirements installs these dependencies and try to replicate that.

A solution was found: amazon web services - Best approach to install gdal for rasterio in aws/lambda/python Dockerfile - Server Fault I didn’t realise host machine architecture could affect docker builds.