lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

base-2:build Images are Misssing Some Development Dependencies

muzfuz opened this issue · comments

The problem

I noticed the following whilst using the build-ruby2.7 image, but I suspect this involves all images that use lambci/lambda-base-2:build.

It appears that several builder dev dependencies are not included via the new base builders as cairo-devel is not included, and I happened to notice that ImageMagick-devel is also not there, which means certain dependencies can't build as seen below:

docker run -it lambci/lambda:build-ruby2.7 /bin/bash
bash-4.2# gem install cairo

Fetching native-package-installer-1.0.9.gem
Fetching pkg-config-1.4.4.gem
Fetching cairo-1.16.6.gem
Successfully installed pkg-config-1.4.4
Successfully installed native-package-installer-1.0.9
Building native extensions. This could take a while...
ERROR:  Error installing cairo:
        ERROR: Failed to build gem native extension.

    current directory: /var/runtime/gems/cairo-1.16.6/ext/cairo
/var/lang/bin/ruby -I /var/lang/lib/ruby/2.7.0 -r ./siteconf20201203-7-4z0vs3.rb extconf.rb
checking for GCC... yes
checking for Homebrew... no
checking for cairo version (>= 1.2.0)... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

The Cause

If you look at the ruby2.5 image then you can see it pulls in the original base image which explicitly installs builder dependencies here..

Looking at the ruby2.7 image it pulls in lambci/lambda-base-2:build.

It's not entirely clear to me yet what this file is doing, but it appears to not be including all the builder dependencies that are listed at the bottom of the readme.

I would be happy to try and fix this with a PR, but I've currently not had the time to fully dive in, so I thought I would open this issue to track it for now.

Yeah, base-2 is a lot smaller (because Amazon Linux 2 is also a lot smaller). If you have dependencies like that you'll need to install them yourself.

I'll make it clear in the README that that's just for the original Amazon Linux 1 based runtimes.

Done! Clarified in README