# hash:sha256:780995d0c763789bea57c3aea4ba5867a546cd29aa50532f268953d1a39fdb27
FROM registry.codeocean.com/codeocean/r-studio:2022.07.0-548-r4.2.1-ubuntu18.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        libgmp3-dev=2:6.1.2+dfsg-2ubuntu0.1 \
        libmpfr-dev=4.0.1-1 \
    && rm -rf /var/lib/apt/lists/*

RUN Rscript -e 'remotes::install_version("Hmisc", "5.1-0")' \
    && Rscript -e 'remotes::install_version("MFPCA", "1.3-10")' \
    && Rscript -e 'remotes::install_version("Matrix", "1.5-0")' \
    && Rscript -e 'remotes::install_version("Rmpfr", "0.9-2")' \
    && Rscript -e 'remotes::install_version("clues", "0.6.2.2")' \
    && Rscript -e 'remotes::install_version("fda", "6.1.4")' \
    && Rscript -e 'remotes::install_version("fpca", "0.2-1")' \
    && Rscript -e 'remotes::install_version("funData", "1.3-8")' \
    && Rscript -e 'remotes::install_version("mvtnorm", "1.2-4")' \
    && Rscript -e 'remotes::install_version("reshape2", "1.4.4")' \
    && Rscript -e 'remotes::install_version("stringr", "1.5.1")' \
    && Rscript -e 'remotes::install_version("xts", "0.13.2")'

COPY postInstall /
RUN /postInstall
