FROM doseme/perlbase
MAINTAINER DoseMe Pty Ltd, software@doseme.com.au

RUN apt-get update && apt-get install -y gsl-bin libgsl23
RUN apt-get update && apt-get install -y libgsl-dev
RUN apt-get update && apt-get -y install expat libexpat-dev

RUN cpanm -v local::lib TAP::Harness::Archive
RUN cpanm -v local::lib TAP::Formatter::JUnit

RUN cpanm -v local::lib TAP::Harness::Archive Dist::Zilla

RUN cpanm -v --installdeps Dist::Zilla::Plugin::VersionFromModule
RUN cpanm -v --notest Dist::Zilla::Plugin::VersionFromModule

RUN cpanm --mirror=https://darkpan.doseme.io --mirror=https://cpan.metacpan.org/ --mirror-only -v Dist::Zilla::PluginBundle::DoseMe~v1.0.0

# FIXME: this PDL version is fixed here and in dist.ini because of LLVM crash when compiling IR on stretch
RUN cpanm -v https://cpan.metacpan.org/authors/id/E/ET/ETJ/PDL-2.021.tar.gz

# bake in dependencies
# FIXME: installing drugs here with --notest due to missing README file in current release archive
RUN cpanm --mirror=https://darkpan.doseme.io --mirror=https://cpan.metacpan.org/ --mirror-only --installdeps -v DoseMe::Drugs
RUN cpanm --mirror=https://darkpan.doseme.io --mirror=https://cpan.metacpan.org/ --mirror-only --notest -v DoseMe::Drugs
RUN cpanm --mirror=https://darkpan.doseme.io --mirror=https://cpan.metacpan.org/ --mirror-only --installdeps -v DoseMe::Algorithms

RUN useradd jenkins --uid 112 --groups 65534 --shell /bin/bash --create-home
