serverless-python-requirements
serverless-python-requirements copied to clipboard
serverless docker images (python 3.9)
I'm wondering if you have considered publishing your own set of python docker images for use in your plugin? Lambci lacks support for python 3.9, despite a PR and several requests. Others are wondering what the status of the project is. It seems they have not updated their other docker images in 10 months or so.
It would be super helpful to have a verified set of images on docker hub from a trusted source.
If it helps, I switched to mlupin/docker-lambda:python3.9-build
how do you "switch" to another image? All I am doing is sls deploy, and it looks for lamci's non-existing 3.9 build image. Where do I specify the docker image for building?
@sscarduzio :
custom:
pythonRequirements:
dockerImage: mlupin/docker-lambda:python3.9-build
See readme.
But, we need some kind of "official" support for those docker images of new python versions.
@mhihasan despite repo's name it's not some kind of official Amazon AWS repo. Just somebody who created docker images that replicate AWS lambda environment. mlupin/docker-lambda is as official as this one is.
This repo was not touched over a year even though owner appears to contribute to other of his repos. I think we are told to move on and he is not interested in maintaining it.
can we just switch to SAM CLI build images? They will always have support https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-image-repositories.html
I've been successful using dockerImage: public.ecr.aws/sam/emulation-python3.9:latest.
Good stuff, but there are some downsides though, comparing to mlupin images. E.g. when pip install psutil on AWS image:
error: command 'gcc' failed: No such file or directory
How about public.ecr.aws/sam/build-python3.9 ?
It works for me.
@tooruuetani thank you, works like a charm.
My config for aarch64 build:
provider:
name: aws
runtime: python3.9
architecture: arm64
custom:
pythonRequirements:
slim: true
dockerizePip: true
dockerRunCmdExtraArgs: [ '--platform', 'linux/arm64/v8' ]
dockerImage: public.ecr.aws/sam/build-python3.9:latest-arm64
Hey everyone, I believe the best way would to be switch to official AWS images as defaults for building. PR #724 proposed that change, but please note that it will require a major version bump as it will be considered a breaking change. I've tested different scenarios for packaging, but any feedback is more than welcome