From 0165504842aea0c6a99af9a50be1282fe390e228 Mon Sep 17 00:00:00 2001 From: sorinvoicu <61691256+sorinvoicu@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:01:43 +0000 Subject: [PATCH] minimal pkg install --- Dockerfile | 16 +++++++++++----- scripts/install_r_pkgs.R | 23 ++++++----------------- scripts/install_sys_deps.sh | 10 +++++++++- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0ea097..0bff197 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,13 @@ FROM ${OS_NAME}:${OS_VERSION} ARG R_VERSION=latest ARG CRAN=https://packagemanager.posit.co/cran/__linux__/jammy/latest + +# https://github.com/jgm/pandoc/tags ARG PANDOC_VERSION=2.9.2.1 +# https://github.com/quarto-dev/quarto-cli/tags ARG QUARTO_VERSION=1.3.450 +# https://github.com/lycheeverse/lychee-action/tags +ARG LYCHEE_VERSION=0.14.3 # Set up environment ENV R_HOME=/usr/local/lib/R @@ -18,11 +23,12 @@ ENV LC_ALL=en_US.UTF-8 COPY rocker_scripts/scripts /rocker_scripts RUN /rocker_scripts/install_R_source.sh && \ - /rocker_scripts/setup_R.sh && \ - /rocker_scripts/install_pandoc.sh && \ - /rocker_scripts/install_quarto.sh && \ - /rocker_scripts/install_texlive.sh && \ - /rocker_scripts/install_tidyverse.sh + /rocker_scripts/setup_R.sh + #&& \ + # /rocker_scripts/install_pandoc.sh && \ + # /rocker_scripts/install_quarto.sh && \ + # /rocker_scripts/install_texlive.sh && \ + # /rocker_scripts/install_tidyverse.sh COPY scripts /scripts RUN /scripts/install_sys_deps.sh && \ diff --git a/scripts/install_r_pkgs.R b/scripts/install_r_pkgs.R index 91fb78e..dfe0137 100755 --- a/scripts/install_r_pkgs.R +++ b/scripts/install_r_pkgs.R @@ -3,24 +3,13 @@ # Get pak package via normal route install.packages("pak") -# Packages to install -install_pkgs <- c( - "shinytest2", - "lintr", - "golem", - "shinymeta", - "shinyjs", - "AzureAuth", - "pharmaverseadam", - "DT", - "openxlsx", - "shinyFeedback" -) - -# Install packages -pak::pak( - pkg = install_pkgs, +# Install davinci package +pak::pkg_install( + pkg = "boehringer-ingelheim/davinci", dependencies = TRUE, ask = FALSE, upgrade = FALSE ) + +# Remove DaVinci packages from image +grep("^dv.", rownames(installed.packages()), value = TRUE) |> sapply(remove.packages) \ No newline at end of file diff --git a/scripts/install_sys_deps.sh b/scripts/install_sys_deps.sh index f3e2463..bbd64bb 100755 --- a/scripts/install_sys_deps.sh +++ b/scripts/install_sys_deps.sh @@ -17,5 +17,13 @@ apt-get autoremove -y apt-get autoclean -y rm -rf /var/lib/apt/lists/* +# Install quarto +QUARTO_DL_URL="https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-$(dpkg --print-architecture).deb" +curl -Ls "$QUARTO_DL_URL" -o quarto.deb && dpkg -i quarto.deb && rm quarto.deb + +# Install pandoc +PANDOC_DL_URL="https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-$(dpkg --print-architecture).deb" +curl -Ls "$PANDOC_DL_URL" -o pandoc.deb && dpkg -i pandoc.deb && rm pandoc.deb + # Install lychee URL checker -curl -sL "https://github.com/lycheeverse/lychee/releases/download/v0.14.3/lychee-v0.14.3-x86_64-unknown-linux-gnu.tar.gz" | tar -xvzf - -C "/usr/local/bin" \ No newline at end of file +curl -Ls https://github.com/lycheeverse/lychee/releases/download/v${LYCHEE_VERSION}/lychee-v${LYCHEE_VERSION}-$(arch)-unknown-linux-gnu.tar.gz | tar xz -C /usr/local/bin \ No newline at end of file