Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions perl-cpan/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions perl-cpan/README.md
Original file line number Diff line number Diff line change
@@ -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)
```