forked from HewlettPackard/cmf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (51 loc) · 2.78 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#Change as necessary: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
#FROM jupyter/datascience-notebook
FROM jupyter/tensorflow-notebook
#FROM jupyter/all-spark-notebook
#FROM jupyter/pyspark-notebook
#FROM nvcr.io/nvidia/tensorflow:21.02-tf1-py3
#FROM nvcr.io/nvidia/pytorch:21.02-py3
#FROM nvcr.io/nvidia/mxnet:21.02-py3
#FROM nvcr.io/nvidia/theano:18.08
#FROM nvcr.io/partners/paddlepaddle:0.11-alpha
#FROM nvcr.io/partners/chainer:4.0.0b1
#Following: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#
ARG NB_USER
ARG NB_UID
ARG NB_GID
# name your environment and choose the python version
#ARG conda_env=python37
#ARG py_ver=3.7
#https://stackoverflow.com/questions/53004311/how-to-add-conda-environment-to-jupyter-lab
#https://gist.github.com/James-Leslie/734babcbc1dd3f5fbc828af773922497
RUN conda install -c conda-forge nb_conda_kernels
# you can add additional libraries you want mamba to install by listing them below the first line and ending with "&& \"
#RUN mamba create --quiet --yes -p "${CONDA_DIR}/envs/${conda_env}" python=${py_ver} ipython ipykernel && \
# mamba clean --all -f -y
#RUN conda activate ${conda_env}
# create Python kernel and link it to jupyter
#RUN "${CONDA_DIR}/envs/${conda_env}/bin/python" -m ipykernel install --user --name="${conda_env}" && \
# fix-permissions "${CONDA_DIR}" && \
# fix-permissions "/home/${NB_USER}"
# any additional pip installs can be added by uncommenting the following line
#RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install --quiet --no-cache-dir
# if you want this environment to be the default one, uncomment the following line:
#RUN apt-get update; apt-get install -y build-essential
USER ${NB_USER}
#RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install --quiet --no-cache-dir 'flake8==3.9.2' && \
# fix-permissions "${CONDA_DIR}" && \
# fix-permissions "/home/${NB_USER}" && \
RUN mkdir /home/${NB_USER}/cmflib/
COPY --chown=${NB_UID}:${NB_GID} Requirements.txt /home/${NB_USER}/cmflib/
RUN "${CONDA_DIR}/bin/pip" install --no-cache-dir --requirement /home/${NB_USER}/cmflib/Requirements.txt && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
COPY --chown=${NB_UID}:${NB_GID} cmflib /home/${NB_USER}/cmflib/cmflib
COPY --chown=${NB_UID}:${NB_GID} setup.py /home/${NB_USER}/cmflib/setup.py
RUN cd /home/${NB_USER}/cmflib && "${CONDA_DIR}/bin/pip" install --no-cache . && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
#ENV PYTHONPATH "${PYTHONPATH}:/home/${NB_USER}/cmflib"
COPY --chown=${NB_UID}:${NB_GID} examples/example-get-started /home/${NB_USER}/example-get-started
# if you want this environment to be the default one, uncomment the following line:
RUN echo "conda activate ${conda_env}" >> "${HOME}/.bashrc"