I did some debugging on why the cpan command was failing. It turns out it was because installing Digest::MD5 relies on a c compiler being present. This resolves the issue by installing gcc. In order to not bloat the image, I've introduced an additional stage purely for the build process (installing dependencies, etc). This also means dos2unix is not included in the final stage, and ca-certificates has also been moved to the test stage (the only stage that actually needs it)
I did some debugging on why the cpan command was failing. It turns out it was because installing Digest::MD5 relies on a c compiler being present. This resolves the issue by installing gcc. In order to not bloat the image, I've introduced an additional stage purely for the build process (installing dependencies, etc). This also means dos2unix is not included in the final stage, and ca-certificates has also been moved to the test stage (the only stage that actually needs it)