Commit 9496b4ef authored by Philippe Grosjean's avatar Philippe Grosjean
Browse files

Update Dockerfile

parent b89a7ef0
Pipeline #246641 passed with stage
in 28 minutes and 47 seconds
# For finding latest versions of the base image see
# https://github.com/SwissDataScienceCenter/renkulab-docker
# For finding rocker images see
# https://github.com/rocker-org/rocker-versioned2
# define build arguments
ARG RENKU_BASE=renku/renkulab-py:3.8-0.8.0
ARG BASE_IMAGE=rocker/geospatial:4.0.5
# define base images
FROM $RENKU_BASE as renku_base
ARG BASE_IMAGE=rrrrrok/renkulab-r-geospatial:4.0.5
FROM $BASE_IMAGE
LABEL maintainer="Philippe Grosjean <phgrosjean@sciviews.org>"
......@@ -26,46 +16,9 @@ ENV CONDA_PATH /opt/conda
# prepend conda and local/bin to PATH
ENV PATH ${HOME}/.local/bin:${CONDA_PATH}/bin:$PATH
# The `rsession` binary that is called by nbrsessionproxy to start R
# doesn't seem to start without this being explicitly set
ENV LD_LIBRARY_PATH /usr/local/lib/R/lib
# pin the version of RStudio
ENV RSTUDIO_VERSION 1.3.959
#ENV RSESSION_PROXY_RSTUDIO_1_4 yes # Required if RStudio version is >= 1.4
# Set PATH for R! It doesn't read from the environment...
# and install pinned RStudio version
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron && \
echo "PATH=${PATH}" >> /etc/profile.d/set_path.sh && \
/rocker_scripts/install_rstudio.sh
# Add Tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini && ln -s /tini /usr/bin/
# install dependencies
RUN apt-get update --fix-missing && \
apt-get install -yq --no-install-recommends \
bzip2 \
ca-certificates \
curl \
gpg-agent && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && \
apt-get install -yq --no-install-recommends \
git-lfs \
gnupg \
jq \
nodejs \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libzmq3-dev \
wget \
vim \
# for mongolite
libsasl2-dev \
# for keyring
......@@ -74,7 +27,7 @@ RUN apt-get update --fix-missing && \
hunspell-en-us \
hunspell-en-gb \
hunspell-fr-classical \
#xdg-utils \
xdg-utils \
net-tools \
nano && \
apt-get purge && \
......@@ -82,22 +35,6 @@ RUN apt-get update --fix-missing && \
apt autoremove --yes && \
rm -rf /var/lib/apt/lists/*
# inject the renku-jupyter stack
COPY --from=renku_base /opt/conda /opt/conda
COPY --from=renku_base --chown=rstudio:rstudio /usr/local/bin/ /usr/local/bin/
COPY --from=renku_base --chown=rstudio:rstudio /home/jovyan/ /home/rstudio/
COPY --from=renku_base /entrypoint.sh /entrypoint.sh
# set permissions of the R library directory to be editable by NB_USER
# This is done in the original image, but we don't want this: we want users to
# install packages in the ~/R folder instead
#ADD fix-permissions.sh /usr/local/bin
#RUN fix-permissions.sh /usr/local/lib/R
RUN chown 1000:1000 /opt/conda && \
usermod -a -G users rstudio && \
# this hack lets some of the setup from the base renku image work here
ln -s /home/${NB_USER} /home/jovyan
# customize RStudio
COPY .config/dictionaries/* /usr/share/hunspell/
RUN mkdir -p /home/rstudio/.config/rstudio/dictionaries && \
......@@ -124,15 +61,6 @@ COPY .config/rstudio-prefs.json /etc/rstudio
USER ${NB_USER}
# set up conda in the NB_USER environment
RUN echo ". ${CONDA_PATH}/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc && \
pip install "jupyter-rsession-proxy==1.1" && \
# install IRKernel
R --quiet -e "install.packages('IRkernel')" && \
R --quiet -e "IRkernel::installspec(prefix='${CONDA_PATH}')" && \
echo "source ~/.bashrc" >> ~/.bash_profile
# install R and python dependencies
COPY install.R /tmp/
COPY requirements.txt /tmp/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment