There are various ways to leverage docker to develop AWS lambda serverless functions. One recent method is to deploy Python Lambda functions with container images (as specified here).
Another method is to develop the Lambda package from within an Amazon Linux docker container and then upload it to AWS Lambda (more details here). A summary of how to do this is described below and will work for any platform where you can install Docker.
Open a command prompt and type:
docker pull lambci/lambda
next, type:
docker run -it lambci/lambda:build-python3.8 bash
This will install the environment to run Python 3.8 code and open a shell prompt so you can start working. The first thing recommended to do when getting the bash prompt is yum update
when you exit the shell, you can always re-enter by typing:
docker start -i container_name
(replace container_name
with the container name of given to the image named lambci/lambda:build-python3.8
, which can be seen via docker ps -a
)