diff --git a/perl-cpan/Dockerfile b/perl-cpan/Dockerfile new file mode 100644 index 00000000..29e9993a --- /dev/null +++ b/perl-cpan/Dockerfile @@ -0,0 +1,23 @@ +# Use Ubuntu 22.04 base +FROM ubuntu:22.04 + +# Install bash explicitly (Ubuntu images usually have it, but to be safe) +RUN apt-get update && apt-get install -y bash gcc make perl + +# Configure CPAN +RUN echo "yes" > CPAN + +# Install cpan module dependency from the following recommendation: https://www.cpan.org/modules/INSTALL.html +RUN cpan App::cpanminus + +# Install some CPAN modules along with their dependencies +RUN cpanm JSON LWP::UserAgent Try::Tiny Class::Data::Inheritable@0.08 + +# App for putting scalibr binary inside the container +RUN mkdir -p /app + +# Set working directory (optional) +WORKDIR /app + +# Default command: start bash so the container stays alive interactively +CMD ["/bin/bash"] diff --git a/perl-cpan/README.md b/perl-cpan/README.md new file mode 100644 index 00000000..a9015bc5 --- /dev/null +++ b/perl-cpan/README.md @@ -0,0 +1,10 @@ +# OSV-Scalibr: Perl Package Manager CPAN Extractor + +This directory contains the test Dockerfile for testing OSV-Scalibr Perl Package Manager CPAN Extractor plugin. The Comprehensive Perl Archive Network (CPAN) currently has 10,000 Perl modules in 10,000 distributions, written by 10,000 authors, mirrored on 1 server. Each CPAN package contains a META.json file that stores their metadata. This plugin finds and extracts these files to determine the inventory. + +## Setup + +```sh +docker build -t cpan-test . +docker run -it --rm -v $(pwd):/app cpan-test (to put scalibr binary inside the container) +```