From f67f974c3df287ebc2ec3104e4f5821881255d12 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 15 May 2017 09:29:38 +0200 Subject: [PATCH] install Julia packages in /opt/julia --- datascience-notebook/Dockerfile | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/datascience-notebook/Dockerfile b/datascience-notebook/Dockerfile index a56216ef..8c314313 100644 --- a/datascience-notebook/Dockerfile +++ b/datascience-notebook/Dockerfile @@ -15,13 +15,21 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Julia dependencies +# install Julia packages in /opt/julia instead of $HOME +ENV JULIA_PKGDIR=/opt/julia + RUN echo "deb http://ppa.launchpad.net/staticfloat/juliareleases/ubuntu trusty main" > /etc/apt/sources.list.d/julia.list && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3D3D3ACC && \ apt-get update && \ apt-get install -y --no-install-recommends \ julia \ libnettle4 && apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + # Show Julia where conda libraries are \ + echo "push!(Libdl.DL_LOAD_PATH, \"$CONDA_DIR/lib\")" >> /usr/etc/julia/juliarc.jl && \ + # Create JULIA_PKGDIR \ + mkdir $JULIA_PKGDIR && \ + chown -R $NB_USER:users $JULIA_PKGDIR USER $NB_USER @@ -45,18 +53,23 @@ RUN conda config --system --add channels r && \ 'r-crayon=1.3*' \ 'r-randomforest=4.6*' && conda clean -tipsy -# Install IJulia packages as jovyan and then move the kernelspec out +# Add Julia packages +# Install IJulia as jovyan and then move the kernelspec out # to the system share location. Avoids problems with runtime UID change not # taking effect properly on the .local folder in the jovyan home dir. -RUN julia -e 'Pkg.add("IJulia")' && \ +RUN julia -e 'Pkg.init()' && \ + julia -e 'Pkg.update()' && \ + julia -e 'Pkg.add("HDF5")' && \ + julia -e 'Pkg.add("Gadfly")' && \ + julia -e 'Pkg.add("RDatasets")' && \ + julia -e 'Pkg.add("IJulia")' && \ + # Precompile Julia packages \ + julia -e 'using HDF5' && \ + julia -e 'using Gadfly' && \ + julia -e 'using RDatasets' && \ + julia -e 'using IJulia' && \ + # move kernelspec out of home \ mv $HOME/.local/share/jupyter/kernels/julia* $CONDA_DIR/share/jupyter/kernels/ && \ chmod -R go+rx $CONDA_DIR/share/jupyter && \ rm -rf $HOME/.local -# Show Julia where conda libraries are -# Add essential packages -RUN echo "push!(Libdl.DL_LOAD_PATH, \"$CONDA_DIR/lib\")" > /home/$NB_USER/.juliarc.jl && \ - julia -e 'Pkg.add("Gadfly")' && julia -e 'Pkg.add("RDatasets")' && julia -F -e 'Pkg.add("HDF5")' - -# Precompile Julia pakcages -RUN julia -e 'using IJulia' && julia -e 'using Gadfly' && julia -e 'using RDatasets'&& julia -e 'using HDF5'