Install modules with perlbrew and cpm - perlbrew switch does not change @INC during docker build

孤街醉人 提交于 2019-12-01 23:32:52

For starters, "A sub-shell is launched with ..." indicates you have an incorrectly setup perlbrew. You were instructed to add the following to your shell's startup script:

source "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}"/etc/bashrc

Without this, a fallback mechanism is used to try to provide the desired functionality, but it's completely useless outside of interactive shells.


Secondly, this is a rather dubious use of perlbrew. If your docker script worked as intended, it would have far reaching consequences. That's not a good thing. You could use perlbrew use, but you could instead use the correct perl build directly using

RUN "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}"/perls/perl-5.31.0/bin/perl -S cpm install -gv CGI

In your case, this should resolve to

RUN /usr/local/perlbrew/perls/perl-5.31.0/bin/perl -S cpm install -gv CGI

for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!