In docker container I have a perl script and I need to be able to parse json I tried to have CPAN JSON
installed for perl in my Dockerfile.
So I am doing the following in my Dockerfile
FROM centos:7.9.2009
RUN yum install -y cpanm \
perl \
perl-App-cpanminus \
perl-Config-Tiny \
sudo \
&& yum clean all \
&& sudo cpanm install JSON;
But when I do a docker build
I get:
#0 41.76 Configuring Test-Simple-1.302195 ... OK
#0 41.95 Building and testing Test-Simple-1.302195 ... OK
#0 68.48 Successfully installed Test-Simple-1.302195
#0 68.59 Building and testing JSON-4.10 ... OK
#0 126.9 Successfully installed JSON-4.10
#0 127.0 2 distributions installed
------
ERROR: failed to solve: executor failed running [/bin/sh -c yum install -y cpanm perl perl-App-cpanminus perl-Config-Tiny sudo && yum clean all && sudo cpanm install JSON;]: exit code: 1
What is the problem here?
cpanm install JSON
will installJSON
but also install a module calledinstall
! You probably just wantedcpanm JSON
.