Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl installation issue using Docker

Tags:

docker

I am trying to build the docker image with perl installation.

Dockerfile:

FROM amazonlinux
WORKDIR /shared
RUN yum -y install gcc
ADD http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz /shared
RUN tar -xzf perl-5.22.1.tar.gz

WORKDIR /shared/perl-5.22.1
RUN ./Configure -des -Dprefix=/opt/perl-5.22.1/localperl

RUN make
RUN make test
RUN make install

all these steps are executed i am can see it executing the make, make test and make install commands but when i do :

docker run -it testsh /bin/bash

Error:

when I check perl -v it says command not found.

and I need to go the perl directory 'cd perl-5.22.1' and run 'make install' again then perl -v works

But I want the perl installation to work when I build it with docker image. can anyone tell me what is going wrong here?

like image 430
nad87563 Avatar asked Dec 11 '25 03:12

nad87563


1 Answers

perl was indeed installed, just wasn't added to the path. export PATH=$PATH:/shared/perl-5.22.1 should do it -- but of course, you'd want to add a PATH update in the Dockerfile.

like image 192
belwood Avatar answered Dec 13 '25 20:12

belwood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!