[AWS Lambda]: How to fix "/lib64/libm.so.6: version `GLIBC_2.29' not found"

Viewed 3338

I'm attempting to use gifsicle in a lambda function utilizing a Node.js 14.x runtime. Executing the function throws the following error:

ERROR /opt/gifsicle: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /opt/gifsicle)

After doing some due diligence, I believe I need to add a layer to my lambda that contains the directory and required dependency noted in the error - but I'm at a total loss as to how to go about doing so.

Any suggestions?

1 Answers

The instructions are available here. The information on how to create the layer content is rather poor. What you need to do is the following:

  • Spawn an EC2 instance with Amazon Linux 2
  • Install gifsicle into it. You probably need to build it from source.
  • Create a zip file. The gifsicle should go to the bin folder and any required libraries to lib folder.

This zip file should be ready to upload as a Lambda layer.

Related