-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
47 lines (34 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM rocker/verse:3.6.1
RUN R -e "devtools::install_github('selcenari/ceRNAnetsim', ref= 'master')"
ENV NB_USER rstudio
ENV NB_UID 1000
ENV VENV_DIR /srv/venv
# Set ENV for all programs...
ENV PATH ${VENV_DIR}/bin:$PATH
# And set ENV for R! It doesn't read from the environment...
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron
# 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
ENV HOME /home/${NB_USER}
WORKDIR ${HOME}
RUN apt-get update && \
apt-get -y install python3-venv python3-dev && \
apt-get purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# This allows non-root to install python libraries if required
RUN mkdir -p ${VENV_DIR} && chown -R ${NB_USER} ${VENV_DIR}
USER ${NB_USER}
RUN python3 -m venv ${VENV_DIR} && \
# Explicitly install a new enough version of pip
pip3 install pip==9.0.1 && \
pip3 install --no-cache-dir \
nbrsessionproxy==0.6.1 && \
jupyter serverextension enable --sys-prefix --py nbrsessionproxy && \
jupyter nbextension install --sys-prefix --py nbrsessionproxy && \
jupyter nbextension enable --sys-prefix --py nbrsessionproxy
RUN R --quiet -e "devtools::install_github('IRkernel/IRkernel')" && \
R --quiet -e "IRkernel::installspec(prefix='${VENV_DIR}')"
CMD jupyter notebook --ip 0.0.0.0
## If extending this image, remember to switch back to USER root to apt-get