-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile-jupyter
61 lines (45 loc) · 1.99 KB
/
Dockerfile-jupyter
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM julia:1.6.1 as builder
ENV USER jovyan
ENV USER_HOME_DIR /home/${USER}
ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia
ENV NOTEBOOK_DIR ${USER_HOME_DIR}/notebooks
ENV JULIA_NUM_THREADS 100
RUN useradd -m -d ${USER_HOME_DIR} ${USER} && \
mkdir -p ${NOTEBOOK_DIR}
RUN apt-get update -y &&\
apt-get upgrade -y &&\
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - &&\
apt-get install -y --no-install-recommends git build-essential &&\
apt-get clean -y &&\
apt-get autoclean -y
USER ${USER}
COPY --chown=${USER}:${USER} . ${USER_HOME_DIR}/
WORKDIR ${USER_HOME_DIR}
RUN mkdir -p ${USER_HOME_DIR}/.julia/environments/v1.6/ &&\
cp *.toml ${USER_HOME_DIR}/.julia/environments/v1.6/ &&\
julia -e "import Pkg; Pkg.activate(); Pkg.instantiate(); Pkg.precompile();"
USER root
RUN julia create_sysimage.jl
FROM jupyter/base-notebook:hub-1.4.1
USER root
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.1-linux-x86_64.tar.gz && \
tar -xvzf julia-1.6.1-linux-x86_64.tar.gz && \
mv julia-1.6.1 /opt/ && \
ln -s /opt/julia-1.6.1/bin/julia /usr/local/bin/julia && \
rm julia-1.6.1-linux-x86_64.tar.gz
COPY --from=builder /usr/local/julia/lib/julia/sys.so /opt/julia-1.6.1/lib/julia/sys.so
COPY --chown=${NB_USER}:users --from=builder /home/jovyan/.julia /home/${NB_USER}/.julia
RUN apt-get update && apt-get install --no-install-recommends -y git && apt-get clean -y && apt-get autoclean -y
USER ${NB_USER}
COPY --chown=${NB_USER}:users ./runpluto.sh ./runpluto.sh
COPY --chown=${NB_USER}:users ./Project.toml ./Project.toml
COPY --chown=${NB_USER}:users ./Manifest.toml ./Manifest.toml
ENV USER_HOME_DIR /home/${NB_USER}
ENV JULIA_PROJECT ${USER_HOME_DIR}
ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia
WORKDIR ${USER_HOME_DIR}
RUN jupyter labextension install @jupyterlab/server-proxy && \
jupyter lab build && \
jupyter lab clean && \
pip install git+https://github.com/pankgeorg/pluto-on-jupyterlab.git --no-cache-dir && \
rm -rf ~/.cache