lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I build image for python3.9 runtime?

mhihasan opened this issue · comments

I am using python3.9 runtime, and that's why I need lambci/lambda:build-python3.9 image. As currently it is not available, I would like to build from myself and use this until any officail release for python3.9.

How could I do that?
Thanks

AWS has a docker image for python 3.9 -> public.ecr.aws/lambda/python:3.9 . Does this solve your problem ?

This image requires requires the handler name to be the first argument of entrypoint, but I want to build lambda layer using that,

docker run --rm  --volume "$PWD:/var/task" --workdir /var/task  public.ecr.aws/lambda/python:3.9 pip install -Ur requirements.txt --target .layers/demo/python

This command throws error,

entrypoint requires the handler name to be the first argument

@mhihasan You can try out the images that I have published for python 3.9 in the meantime.

docker run --rm --volume "$PWD:/var/task" --workdir /var/task senorcoder/aws-lambda-env:python3.9_build pip install -Ur requirements.txt --target .layers/demo/python

Runtime: senorcoder/aws-lambda-env:python3.9
Build  : senorcoder/aws-lambda-env:python3.9_build

Repository Reference:
https://github.com/senor-coder/aws-lambda-pyruntime

Thanks a lot, it works. 👍