Closed nodanaonlyzuul closed 3 years ago
are you saying that using a custom image as shown in the config example does not work?
https://github.com/joshuaflanagan/serverless-ruby-package#configuration
I'm guessing you're going to need to add a lambda layer or other means to add the native libs to your deployment package
Oh @apsoto - I'm such a dope.
It's super easy for me to make my own image, FROM: lambci/lambda:build-ruby2.X
which yum installs.
I totally missed the documentation (and source!) about customizing the build image via this.config.dockerImage
.
Chalk that up to being awake way too late.
I'm sure it works fine (haven't had the chance to run it) That's probably the shortest path for my case. But I really appreciate the layer example you provided.
this.config.dockerImage
is busted for me. (It won't be).
Thanks
Firstly - thanks so much for
serverless-ruby-package
.It's saved the day for me and the orgs I work for time-and-time-again and has opened the door for us to use Ruby for our lambdas (which has...in turn...saved many days).
The Problem
I imagine using serverless-ruby-package to deploy Lambdas that use the
pg
gem is a well-trod path. But I'm running into problems at build time. I have a Lambda that uses pg (1.2.3) I get the following error on runningserverless invoke local
with the--docker
flag.I understand the heart of this problem is with
lambci/lambda:build-ruby2.5
either not including thepostgresql-devel
andpostgresql-libs
packages or putting them in an unexpected (for bundler) location.I've thought of a few different way's it could be solved but each is a slippery slope.
For example...
I could create my own docker image image
FROM: lambci/lambda:build-ruby2.5
whichyum installs
the appropriate libs, but thenserverless-ruby-package
is hardwired to uselambci/lambda:build-ruby2.X
, then I'd have to fork serverless-ruby-package. That's enough work to make me imagine I'm working too hard. Hah.Do you know a way to install the pg gem and stay on the serverless ==> serverless-ruby-package path?
Example App
You can re-produce this problemby running:
In the with-native-extensions branch of nodanaonlyzuul/kinesis-lambda-example