serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

Workaround for node 18 and using docker?

Open OscBacon opened this issue 1 year ago • 3 comments

Hi, Is there any workaround or tipe for using node 18 and testing with useDocker?

OscBacon avatar May 04 '23 10:05 OscBacon

@OscBacon Seems like I am having the same issue, cannot use lambda layers in serverless-offline. Looks like the base image of docker used by serverless-offline for Node 18 is deprecated : https://github.com/lambci/docker-lambda for https://github.com/aws/aws-lambda-base-images

Hopefully team responds soon with some workarounds.

fahimuddin-brillmark avatar May 04 '23 11:05 fahimuddin-brillmark

serverless-offline is currently using lambci images for Docker, as @fahimuddin-brillmark mentioned, which were abandoned a long while ago and haven't been updated in years. Serverless itself is in the same situation with its serverless invoke local - it is still currently using lambci too. I did a write-up about what it would take to update that codebase to using the latest AWS images and feel it's pretty relevant here too: https://github.com/serverless/serverless/issues/10797#issuecomment-1544922990

Key takeaways are that the mapping a handler to a Lambda runtime container isn't just as simple as a string replacement or templating any longer (requiring a bit of logic), and the internals workings of the containers are understandably different.

My use case was looking at getting Go working under provider.al2 (the current runtime since go1.x is EOL), and as with Serverless itself, some work would be needed to make serverless-offline compatible, although I did start with #1691.

davidjb avatar May 12 '23 01:05 davidjb

thanks @davidjb - helped me a lot :)

manfioLP avatar Jan 31 '24 14:01 manfioLP

@OscBacon @davidjb @manfioLP @fahimuddin-brillmark This should now be fixed. I just merged a PR that solves this issue - #1755

DorianMazur avatar Apr 23 '24 21:04 DorianMazur