Creating AWS lambda package with sls package

I am trying to execute sls commands from GITLAB CI,

image: alpine
commands -

  • npm install -g serverless
  • npm install
  • sls package

serverless.yml -
plugins:

  • serverless-python-requirements
    custom:
    pythonRequirements:
    dockerizePip: non-linux
    pythonBin: python

sls package command throws error for which need to do this -
apk add gcc musl-dev python3-dev libffi-dev openssl-dev

zip file is created but when Deployed, lambda is throwing error - ImportError: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory
If I locally run sls package command and upload zip file to lambda, it works fine

Tried doing this - ln /usr/lib/libc.so /usr/lib/libc.musl-x86_64.so.1 , did not help.

So I wrote a GitHub Python package that I want to use in my AWS lambda function. The way I’ve been able to do this now is to directly upload the package folder in the file directory of the AWS Speed Test Lambda function so it can be imported.