docker/jupyter/build/r.Dockerfile

57 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2022-10-01 17:30:14 -07:00
ARG BASE_CONTAINER=betalupi/jupyter-base
FROM $BASE_CONTAINER
LABEL maintainer="Mark <mark@betalupi.com>"
# R pre-requisites
USER root
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
fonts-dejavu \
unixodbc \
unixodbc-dev \
r-cran-rodbc \
gfortran \
gcc && \
apt-get clean && rm -rf /var/lib/apt/lists/*
USER ${NB_UID}
RUN mamba install --quiet --yes \
"r-base" \
"r-caret" \
"r-crayon" \
"r-devtools" \
"r-e1071" \
"r-forecast" \
"r-hexbin" \
"r-htmltools" \
"r-htmlwidgets" \
"r-irkernel" \
"r-nycflights13" \
"r-randomforest" \
"r-rcurl" \
"r-rmarkdown" \
"r-rodbc" \
"r-rsqlite" \
"r-shiny" \
"r-tidyverse" \
"unixodbc" && \
# Cleanup
mamba clean --all -f -y && \
npm cache clean --force && \
jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# `rpy2` and `r-tidymodels` are not easy to install under arm
RUN set -x && \
arch=$(uname -m) && \
if [ "${arch}" == "x86_64" ]; then \
mamba install --quiet --yes \
"rpy2" \
"r-tidymodels" && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"; \
fi;
USER ${NB_UID}