Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set PERL5LIB to /usr/lib in perl/stretch-slim (maybe others) #56

Closed
JJ opened this issue Sep 19, 2018 · 5 comments
Closed

Set PERL5LIB to /usr/lib in perl/stretch-slim (maybe others) #56

JJ opened this issue Sep 19, 2018 · 5 comments

Comments

@JJ
Copy link

JJ commented Sep 19, 2018

I have been figtingh with this image for long time, to eventually discover that, first, some modules available in the latest couldn't be installed here, and second, that when I installed them using default debian packages, they were not available to Perl. That's probably a feature of the perl version you are installing, and I know you can define env variables when running a Docker image, but since /usr/lib is the default place for installing system-wide modules, would it be possible to have it somehow built-in so that it's used from all Perl scripts?

@zakame
Copy link
Member

zakame commented Sep 19, 2018

Hi @JJ, thanks for the report!

This is basically the same as #26 (for the case of installing CPAN modules via Debian packages) but I'm curious as to what particular modules you're having difficulty installing here; I take that you're using cpanm as well to install those latest modules?

Note that by default, docker-perl installs CPAN modules to -Dsiteprefix, which is usually in /usr/local/lib/perl5/site_perl/5.XX.X.

@JJ
Copy link
Author

JJ commented Sep 19, 2018 via email

@zakame
Copy link
Member

zakame commented Sep 19, 2018

Some lwp::simple deps such as html::entities and HTML::tagset. It's in my jmerelo/iv-test image

I suppose it is this image Dockerfile? If so, I think you'll need a few things here:

  • since you're using perl:slim, you'll need to install the build toolchain gang such as gcc, make, and libc6-dev
  • once the above are installed, you can now cpanm LWP::Simple <other CPAN deps>
  • I recommend listing your module dependencies in a cpanfile so that your module installation can simply become cpanm --installdeps ., instead of having to list these directly in the Dockerfile

Putting that all together, your Dockerfile might become like this:

FROM perl:5.28-slim

WORKDIR /test

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
       gcc make libc6-dev \
    && cpanm Test::More Test::Harness Git File::Slurper \
       JSON Net::Ping TAP::Formatter::Color Term::ANSIColor \
       LWP::Simple

VOLUME /test

ENTRYPOINT ['/usr/local/bin/prove', '-c']

I'm able to install those modules listed above into the resulting image; if there are other dependencies, let me know so I can test as well.

@JJ
Copy link
Author

JJ commented Sep 19, 2018 via email

@zakame
Copy link
Member

zakame commented Jul 27, 2019

It seems this is now resolved? I'll close this for now; feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants