1- FROM jupyter/scipy-notebook
1+ FROM jupyter/scipy-notebook as base
22
33ARG user=euler
4+ ARG branch=chap6
45
56USER root
67
@@ -16,29 +17,34 @@ ENV NB_USER=${user}
1617ENV XDG_CACHE_HOME=/home/${user}/.cache/
1718
1819RUN git clone https://github.com/deusebio/Graph-Machine-Learning.git /home/${user}/Graph-Machine-Learning
19-
2020WORKDIR /home/${user}/Graph-Machine-Learning
21+ RUN git checkout ${branch}
2122
2223RUN ln -s /data data
24+ EXPOSE 8888
2325
24- RUN git checkout chap6
26+ ENTRYPOINT jupyter notebook --no-browser --port 8888 --NotebookApp.token= '' --NotebookApp.password= ''
2527
28+ FROM base as chap1
29+ RUN ls -d -1 */ | grep -v -e Chapter01 | xargs rm -rf
2630RUN conda create -n chap1 python=3.9
2731RUN conda run -n chap1 pip install -r Chapter01/requirements.txt
2832RUN conda run -n chap1 python -m ipykernel install --name chap1 --user
2933
34+ FROM base as chap2
35+ RUN ls -d -1 */ | grep -v -e Chapter02 | xargs rm -rf
3036RUN conda create -n chap2 python=3.11
3137RUN conda run -n chap2 pip install -r Chapter02/requirements.txt
3238RUN conda run -n chap2 python -m ipykernel install --name chap2 --user
3339
40+ FROM base as chap3
41+ RUN ls -d -1 */ | grep -v -e Chapter03 | xargs rm -rf
3442RUN conda create -n chap3 python=3.8
3543RUN conda run -n chap3 pip install -r Chapter03/requirements.txt
3644RUN conda run -n chap3 python -m ipykernel install --name chap3 --user
3745
46+ FROM base as chap6
47+ RUN ls -d -1 */ | grep -v -e Chapter06 | xargs rm -rf
3848RUN conda create -n chap6 python=3.8
3949RUN conda run -n chap6 pip install -r Chapter06/requirements.txt
4050RUN conda run -n chap6 python -m ipykernel install --name chap6 --user
41-
42- EXPOSE 8888
43-
44- ENTRYPOINT jupyter notebook --no-browser --port 8888 --NotebookApp.token='' --NotebookApp.password=''
0 commit comments