I am creating an image in wsl with scripting starting from a base Amazon Linux2 import. The following is some of the scripting. The {{THIRDPARTYCACHE}} label is replaced with a path to persistent storage, persistent in that it survives through distribution unregistration (image destroy) :
sudo yum -y --setopt=cachedir={{THIRDPARTYCACHE}}/yum/cache install \
dejavu-sans-fonts.noarch \
freetds \
mailx \
moreutils \
nmon \
perl-Archive-Zip \
perl-Class-Accessor \
perl-DateTime \
perl-DateTime-Format-Strptime \
perl-DBD-MySQL \
perl-DBI \
perl-Digest-SHA \
perl-GD \
perl-JSON \
perl-libwww-perl \
perl-Log-Log4perl \
perl-LWP-Protocol-https \
perl-parent \
perl-XML-Parser \
pigz \
rng-tools \
ruby \
smem \
sysstat \
tree \
nmap-ncat \
git \
git-lfs \
xorg-x11-server-Xvfb \
wget \
openssl11 \
"perl(Data::Dump)" \
libXtst \
which \
perl-Coro \
perl-AnyEvent-AIO \
perl-PadWalker \
perl-App-cpanminus \
net-tools \
nss-tools
sudo yum -y --setopt=cachedir={{THIRDPARTYCACHE}}/yum/cache group install "development tools"
sudo cpanm --no-test Perl::LanguageServer
The last two lines take a significant amount of time and successfully achieve the desired result of the installing the perl module Perl::LanguageServer. The final message from cpanm is: Successfully installed Perl-LanguageServer-v2.5.0 48 distributions installed
I'm looking for a way that I could cache the Perl::LanguageServer (along with all it's dependencies) allowing the ability to potentially skip the development tools group install and the compile/build of the module and all it's dependencies.