无法在Docker文件中安装Perl模块。

huangapple go评论71阅读模式
英文:

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 library in the environment?

I've tried yum update but it does not resolve this 无法在Docker文件中安装Perl模块。

英文:

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 无法在Docker文件中安装Perl模块。

答案1

得分: 3

yum install 是 Fedora/RedHat/CentOS 安装软件包的方式。这些项目使用 perl-Foo-Bar 命名约定来打包 Perl 模块。因此,你可以尝试:

RUN yum install -y perl-Text-Roman

libfoo-bar-perl 是 Debian/Ubuntu 的命名约定。如果你使用这些发行版(但看起来你不是),那么你应该使用 apt 而不是 yum 来安装它。

RUN apt install libtext-roman-perl
英文:

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

huangapple
  • 本文由 发表于 2023年2月6日 16:47:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75359076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定