Using Docker to Check for Prerequisites

While updating Set::Jaccard::SimilarityCoefficient to v1.6.1, I realized that I should install it on a clean, clean system so I find all missing prerequisites (not just the ones I already knew about). So where do I get a clean, clean system? Aha - a minimal Docker container (like the plain-vanilla Ubuntu 16.04 LTS) would be just the ticket as I am using an Ubuntu 16.04 LTS laptop. As an example, here are the steps I ran through:

  • Run: "sudo docker run -v /home/mark/src/perllib/Set-Jaccard-SimilarityCoefficient/Set-Jaccard-SimilarityCoefficient-1.6.0:/Set-Jaccard-SimilarityCoefficient-1.6.0 -it ubuntu".

  • Because this is a plain-vanilla Ubuntu, I need to install some development tools (including missing pieces of Perl) by running: "apt-get update; apt-get install gcc make perl-modules-5.22". Followed by: "cpan -i App::cpanminus"

(If anyone points out in the comments how I could use the direct "curl" install for "cpanm" rather than using "cpan", I will update these directions.)

  • Run "cd /Set-Jaccard-SimilarityCoefficient" followed by: "perl Makefile.PL" to check for dependencies while we build the Makefile.

  • Finally, run: "cpanm Exception::Class ReadonlyX Set::Scalar Test::Most" to install the missing dependencies (which are noted in the "perl Makefile.PL" step due to my fixes for v1.6.0).

Note that this is applicable to finding the dependencies for any installation - I just picked Set::Jaccard::SimilarityCoefficient because I was working on it yesterday. I could just as well picked a Go program, a Ruby on Rails project, or even Pugs (the Perl 6 interpreter written in Haskell).

Leave a comment

About Mark Leighton Fisher

user-pic Perl/CPAN user since 1992.