Hey,
I am curious to know where do things I install through Dockerfile go. Is it /tmp or /opt? Also, is it a bad idea to install all the application dependencies through Dockerfile?
@harshthakur9030 It depends on what you mean by "application dependencies" - this plugin aims to help solve Python-based project package dependencies.
The README shows a couple of examples of using a custom Dockerfile:
https://github.com/UnitedIncome/serverless-python-requirements#native-code-dependencies-during-build
And whatever directives you provide in your custom Dockerfile is where the resulting files will be in that Docker Image - and then you can use the dockerExtraFiles configuration directive to instruct this plugin on which other files you may need in the lambda deployment package.
Got it . I am facing an issue and I am not sure if this plugin can help. I would like to use dlib library in lambda. I installed it on the docker image(lambdaci/lambda) and wrote a Dockerfile for it which I added to the serverless.yml manifest . Dlib gets imported successfully in the container but fails on lambda for some reason. Here's how I know that:
ImportError("/lib64/libm.so.6: versionGLIBC_2.27' not found (required by /var/task/dlib.cpython-37m-x86_64-linux-gnu.so)")`
That looks like some sort of version mismatch between the GLIBC version available in the Python 3.7 and the version requested in the compiled libm.so library.
A quick google search found this article that might be useful: https://stackoverflow.com/q/54616024/244037
Isn't the docker image I am using(lambdaci/lambda) the same image AWS lambda uses or did I get that wrong?
Update: I just checked the glibc version in the docker image I'm using and in the Lambda. They're the same version 2.17. I followed this tutorial to build my dependencies layer: https://aws.amazon.com/premiumsupport/knowledge-center/lambda-layer-simulated-docker/ . I'm clueless to why this is happening.
I tried to reproduce and couldn't - saw the same on glibc 2.17 in the image.
I guess if you can provide more reproduction details, someone could try to determine the cause - I did pip install dlib and the basics worked for me.
I needed a clean start to fix it. After a "sls remove", I'm able to import it successfully on lambda. Thanks
Glad to hear it worked out!