1

I am trying to install perl 5.12.3 onto a Fedora 33 Docker image in my dockerfile however when I attempt to build the image I am faced with this error:

/bin/sh: line 1: /dev/tty: No such device or address
make[1]: Leaving directory '/'
make[1]: [makefile:964: minitest] Error 1 (ignored)
./miniperl -Ilib autodoc.pl
make: *** [makefile:513: pod/perlintern.pod] Segmentation fault (core dumped)

This is how I am attempting to install it:

RUN wget https://www.cpan.org/authors/id/R/RJ/RJBS/perl-5.12.3.tar.gz
RUN tar -xzf perl-5.12.3.tar.gz
RUN perl-5.12.3/Configure -Dmksymlinks -des -Dprefix=/usr/local/ -d y &&\
    make && \
    make test && \
    make install
RUN perl -v

I guess that the problem is that docker is running the build context with no stdin or tty. Does anyone know a fix for this? I tried to install perlbrew instead to accomplish this but that was already proving to have quite a few of its own issues. Thank you for any help or advice. I am open to any other methods to installing perl 5.12.3 in the image.

Dallas H
  • 13
  • 2

1 Answers1

0

I was able to install Perl version 5.12.4 with perlbrew like this (building fedora:33 docker image from my Ubuntu 21.04 laptop):

Dockerfile:

FROM fedora:33
SHELL ["/bin/bash", "-c"]
RUN yum -y update \
        && yum -y install gcc gcc-c++ make curl \
        vim wget zlib-devel openssl-devel bzip2 patch \
        perl-CPAN perl-App-cpanminus

ARG user=root
ARG home=/$user
WORKDIR $home
USER $user
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]

entrypoint.sh:

curl -L https://install.perlbrew.pl | SHELL=/bin/bash bash
echo 'export PERLBREW_ROOT=$HOME/perl5/perlbrew' >> .bashrc
echo 'source $PERLBREW_ROOT/etc/bashrc' >> .bashrc
export PERLBREW_ROOT=$HOME/perl5/perlbrew
source $PERLBREW_ROOT/etc/bashrc
perlbrew install --notest --noman perl-5.12.4
perlbrew install-cpanm
perlbrew switch perl-5.12.4
perl --version
exec bash
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174