From f318b0b90994026185bc16bc2bdadb3f5586675e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20G=C3=B6ksel?= Date: Fri, 6 Feb 2026 15:43:25 +0300 Subject: [PATCH 1/2] Add CPAN Package Manager Environment for OSV-Scalibr --- perl-cpan/Dockerfile | 23 +++++++++++++++++++++++ perl-cpan/README.md | 10 ++++++++++ 2 files changed, 33 insertions(+) create mode 100644 perl-cpan/Dockerfile create mode 100644 perl-cpan/README.md diff --git a/perl-cpan/Dockerfile b/perl-cpan/Dockerfile new file mode 100644 index 00000000..c60e3c98 --- /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 + +# 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) +``` From a57ba775eb67259efd02693a5ee9bef4057f1cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20G=C3=B6ksel?= Date: Wed, 11 Feb 2026 20:45:11 +0300 Subject: [PATCH 2/2] Add an old packet that only supports YML metadata file --- perl-cpan/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-cpan/Dockerfile b/perl-cpan/Dockerfile index c60e3c98..29e9993a 100644 --- a/perl-cpan/Dockerfile +++ b/perl-cpan/Dockerfile @@ -11,7 +11,7 @@ RUN echo "yes" > CPAN RUN cpan App::cpanminus # Install some CPAN modules along with their dependencies -RUN cpanm JSON LWP::UserAgent Try::Tiny +RUN cpanm JSON LWP::UserAgent Try::Tiny Class::Data::Inheritable@0.08 # App for putting scalibr binary inside the container RUN mkdir -p /app