Since the library you use requires your own libraries, you must also pack your own .so files with the layer. I encountered a similar problem when trying to run wkhtmltopdf on lambda-aws.
The binaries for the library must be compiled in the same environment as the lambda instance. Lambda boots using AWS Linux.
You can download EC2 running AmazonLinux or use Docker, the easiest way is to load the Docker container.
$ sudo docker run -it amazonlinux bash
Now you need to download / unzip all .so files to a directory, and then compress it. Also make sure all .so files are stored in a folder named lib inside zip. After archiving, it should look something like this:
. βββ lib β βββ libcrypto.so.10 β βββ libcrypto.so.1.0.2k β βββ libfontconfig.so.1 β βββ libfontconfig.so.1.7.0 .......
Then you can simply compress it and load it as a layer. It will be loaded in / opt / in your Lambda container. AWS looks for library files in / opt / lib among many other places .
The challenge is for you to figure out how to get all the necessary .so files so that your dependency works correctly.
source share