1- FROM ubuntu:18 .04
1+ FROM ubuntu:20 .04
22
33ENV EDITOR=/bin/nano
44ENV PYWIKIBOT2_DIR=/srv/paws
@@ -21,14 +21,15 @@ RUN adduser --disabled-password \
2121WORKDIR ${HOME}
2222
2323# Base building utilities that'll always be required, probably
24- RUN apt-get update --yes
25- RUN apt-get install --yes \
24+ RUN apt-get update > /dev/null && \
25+ apt-get install --yes \
2626 git \
2727 locales \
2828 pkg-config \
2929 build-essential \
3030 gcc \
31- apt-transport-https
31+ apt-transport-https > /dev/null
32+
3233RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
3334 locale-gen
3435
@@ -40,16 +41,23 @@ ENV LANGUAGE en_US.UTF-8
4041ADD node/nodesource.gpg.key /etc/apt/trusted.gpg.d/nodesource.gpg.key
4142ADD node/nodesource.list /etc/apt/sources.list.d/nodesource.list
4243RUN apt-key add /etc/apt/trusted.gpg.d/nodesource.gpg.key
43- RUN apt-get update --yes
44+
45+ # Use newer version of R
46+ # Binary packages from packagemanager.rstudio.com work against this.
47+ # Base R from Focal is only 3.6.
48+ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
49+ RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/" > /etc/apt/sources.list.d/cran.list
4450
4551# Install languages needed and their core dev packages
46- RUN apt-get install --yes \
52+ RUN apt-get update --yes > /dev/null && \
53+ apt-get install --yes \
4754 python3 \
4855 python3-dev \
4956 python3-venv \
5057 r-recommended \
5158 r-base-dev \
52- nodejs
59+ r-cran-littler \
60+ nodejs > /dev/null
5361
5462# Utilities
5563RUN apt-get install --yes \
@@ -61,7 +69,7 @@ RUN apt-get install --yes \
6169 links \
6270 nano \
6371 vim \
64- mariadb-client
72+ mariadb-client > /dev/null
6573
6674# Machine-learning type stuff
6775RUN apt-get install --yes \
@@ -80,42 +88,49 @@ RUN apt-get install --yes \
8088 libzmq3-dev \
8189 libreadline-dev \
8290 # For R's mysql
83- libmariadb-client-lgpl- dev \
91+ libmariadb-dev \
8492 # For R's curl
8593 libcurl4-openssl-dev \
8694 # For R's devtools
8795 libssl-dev \
8896 # For PDFs and stuff
8997 pandoc \
90- texlive-xetex
98+ texlive-xetex > /dev/null
99+
100+ # Create user owned R libs dir
101+ # This lets users temporarily install packages
102+ ENV R_LIBS_USER /srv/r
103+ RUN install -d -o ${NB_USER} -g ${NB_USER} ${R_LIBS_USER}
104+
105+ # Create venv directory, and let users install into it
106+ ENV VENV_DIR /srv/paws
107+ RUN install -d -o ${NB_USER} -g ${NB_USER} ${VENV_DIR}
91108
92- RUN mkdir -p /srv/paws && chown ${NB_USER}:${NB_USER} /srv/paws
93109ENV PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:$PATH
94110
95111USER ${NB_USER}
96- RUN python3.6 -m venv /srv/paws
112+ RUN python3 -m venv /srv/paws
97113
98114# Install base notebook packages
99115RUN pip install --no-cache-dir \
100116 jupyterhub==1.1.0 \
101- notebook \
102- jupyterlab \
117+ notebook==6.3.* \
118+ jupyterlab==3.* \
103119 bash_kernel
104120
105121# Install the bash kernel
106122RUN python -m bash_kernel.install --sys-prefix
107123
108- # Install the R Kernel and libraries
109- COPY install-r /usr/local/bin/install-r
124+ # Set CRAN mirror to rspm before we install anything
125+ COPY Rprofile.site /usr/lib/R/etc/Rprofile.site
110126
111- # We need root simply to install the kernelspec lol
112- # https://github.com/ IRkernel/IRkernel/issues/495
113- USER root
114- RUN /usr/local/bin/install-r
127+ # Install the R Kernel
128+ RUN r -e "install.packages(' IRkernel', version='1.1.1')" && \
129+ r -e "IRkernel::installspec(prefix='${VENV_DIR}')" && \
130+ rm -rf /tmp/downloaded_packages
115131
116132# Install mass amount of python libraries!
117133COPY --chown=tools.paws:tools.paws requirements.txt /tmp/requirements.txt
118- USER ${NB_USER}
119134
120135RUN pip --no-cache-dir install -r /tmp/requirements.txt
121136
@@ -130,12 +145,9 @@ RUN /usr/local/bin/install-pwb
130145COPY install-extensions /usr/local/bin/
131146RUN /usr/local/bin/install-extensions
132147
133-
134148COPY banner /etc/bash.bashrc
135149
136150# use custom css to hide clusters tab
137151COPY --chown=tools.paws:tools.paws hide_clusters_tab.css /home/paws/.jupyter/custom/custom.css
138152
139- USER ${NB_USER}
140-
141153EXPOSE 8888
0 commit comments