Reputation: 67440
This is a continuation of How do you install phantomjs on AWS lambda? I've figured out how to get phantomjs running on an aws lambda, but when I use it to generate pdfs (using the html-pdf nodejs library), the content is missing text. If I create a docker container that's using FROM node:10.16.0-jessie
on it, the pdfs render fine. If I create a docker container using FROM amazonlinux:2.0.20190508
(which I think is similar to the AWS lambda container), the text is missing on my PDFs.
I've fixed this problem in amazonlinux:2.0.20190508
by running yum install fontconfig
. But, I don't know how to do the equivalent of a yum install fontconfig
inside a real lambda. If you look at the link above, you'll see that an answer there attempts to provide that information, but for whatever reason, it still doesn't work correctly. I believe the reason is there's still a missing step on how to get the fontconfig install properly extracted from the amazonlinux:2.0.20190508
container.
In summary, here is my question: After I run yum install fontconfig
in amazonlinux:2.0.20190508
, how do I extract it from the container and package it up so that an AWS Lambda can use it?
By the way, I'm sure there are other answers that seem to be answering this question, but the AWS lambda built-in dependencies change so frequently, none of those answers work anymore.
Upvotes: 2
Views: 3692
Reputation: 21
In my case, I did this:
FROM amazonlinux:2.0.20190508
RUN yum -y install fontconfig freetype
and build it as example:latest
docker run -v D:\dockerFiles:/mnt --rm -it example:latest
/lib64
libbz2.so.1 libexpat.so.1 libfontconfig.so.1 libfreetype.so.6 libpng15.so.15
/mnt/lib
. Take lib
from D:\dockerFiles
and zip folder lib.Upvotes: 2