Eugene
Eugene

Reputation: 1125

Unable to install perl module in docker file

I am trying to build a lambda layer with Perl support using this prebuilt docker image: https://metacpan.org/pod/AWS::Lambda#Use-Pre-built-Docker-Images

Now I am trying to add this library libtext-roman-perl into the docker image with:

FROM shogo82148/p5-aws-lambda:base-5.36.al2
RUN yum install -y libtext-roman-perl
COPY handler.pl /var/task/
CMD [ "handler.handle" ]

but it is showing No package libtext-roman-perl available. Is this because there is no repository containing this libray in the environment?

I've tried yum update but it does not resolve this :(

Upvotes: 1

Views: 406

Answers (1)

tobyink
tobyink

Reputation: 13664

yum install is Fedora/RedHat/CentOS's way to install packages. These projects use the naming convention perl-Foo-Bar for packaging Perl modules. So you could try:

RUN yum install -y perl-Text-Roman

libfoo-bar-perl is the naming convention of Debian/Ubuntu. If you're using one of those distributions (but you don't seem to be), then you'd use apt to install it instead of yum.

RUN apt install libtext-roman-perl

Upvotes: 3

Related Questions