Skip to content

Commit

Permalink
minimal pkg install
Browse files Browse the repository at this point in the history
  • Loading branch information
sorinvoicu committed Apr 11, 2024
1 parent 4a23a25 commit 0165504
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 && \
Expand Down
23 changes: 6 additions & 17 deletions scripts/install_r_pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 9 additions & 1 deletion scripts/install_sys_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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

0 comments on commit 0165504

Please sign in to comment.