2017-06-08 34 views
1

我正在嘗試使用perl安裝構建docker映像。但面臨make命令的問題。它說沒有找到makefile。 Dockerfile:使用docker執行Perl安裝

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 
RUN /shared/perl-5.22.1/Configure -des -Dprefix=/opt/perl-5.22.1/localperl 
RUN make -C /shared/perl-5.22.1 
RUN make -C /shared/perl-5.22.1 test 
RUN make -C /shared/perl-5.22.1 install 

錯誤:

Step 14/20 : ADD http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz /shared 
Downloading 15.92 MB/15.92 MB 
---> Using cache 
---> 24f3b38dee5f 
Step 15/20 : RUN tar -xzf perl-5.22.1.tar.gz 
---> Using cache 
---> 42ecf82ce73d 
Step 16/20 : RUN /shared/perl-5.22.1/Configure -des -Dprefix=/opt/perl-5.22.1/localperl 
---> Using cache 
---> dfe8d71f5ff1 
Step 17/20 : RUN make -C /shared/perl-5.22.1/ 
---> Running in 2766b0c8e9a5 
make: Entering directory `/shared/perl-5.22.1' 
make: Leaving directory `/shared/perl-5.22.1' 
make: *** No targets specified and no makefile found. Stop. 
The command '/bin/sh -c make -C /shared/perl-5.22.1/' returned a non-zero code: 2 
ish-mac:testanalyse ish$ ls -l 

誰能幫我解決這個問題。

回答

2

作爲自述說,只需運行make,但改變目錄的源代碼的根(/shared/perl-5.22.1):

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 

自述:

INSTALLATION 
============ 

If you're using a relatively modern operating system and want to 
install this version of Perl locally, run the following commands: 

    ./Configure -des -Dprefix=$HOME/localperl 
    make test 
    make install