|
1 | | -FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04 |
2 | | -# Contributors: Syed Navaid (https://github.com/syedahmad) |
3 | | -# Vlad Hosu (https://github.com/subpic) |
| 1 | +FROM nvcr.io/nvidia/tensorflow:20.09-tf2-py3 |
4 | 2 |
|
| 3 | +ENV DEBIAN_FRONTEND noninteractive |
5 | 4 | RUN apt-get update && apt-get install -y \ |
6 | | -wget \ |
7 | | -vim \ |
8 | | -bzip2 \ |
9 | | -graphviz \ |
10 | | -mc \ |
11 | | -htop \ |
12 | | -emacs-nox \ |
13 | | -rsync \ |
14 | | -less \ |
15 | | -curl \ |
16 | | -#software-properties-common \ |
17 | | -build-essential \ |
18 | | - libfreetype6-dev \ |
19 | | - libpng12-dev \ |
20 | | - openssh-client |
21 | | - |
22 | | -RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash |
23 | | - |
24 | | -#Downgrade CUDA, TF issue: https://github.com/tensorflow/tensorflow/issues/17566#issuecomment-372490062 |
25 | | -RUN apt-get install --allow-downgrades --allow-change-held-packages -y libcudnn7=7.0.5.15-1+cuda9.0 git-lfs |
26 | | - |
27 | | -#Install MINICONDA |
28 | | -RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O Miniconda.sh && \ |
29 | | -/bin/bash Miniconda.sh -b -p /opt/conda && \ |
30 | | -rm Miniconda.sh |
| 5 | +wget \ |
| 6 | +vim \ |
| 7 | +bzip2 \ |
| 8 | +graphviz \ |
| 9 | +mc \ |
| 10 | +htop \ |
| 11 | +emacs-nox \ |
| 12 | +rsync \ |
| 13 | +less \ |
| 14 | +curl \ |
| 15 | +build-essential \ |
| 16 | +openssh-server \ |
| 17 | +imagemagick |
31 | 18 |
|
| 19 | +# Install MINICONDA |
| 20 | +RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O Miniconda.sh && \ |
| 21 | + /bin/bash Miniconda.sh -b -p /opt/conda && \ |
| 22 | + rm Miniconda.sh |
32 | 23 | ENV PATH /opt/conda/bin:$PATH |
| 24 | +RUN conda update -y -n base -c defaults conda |
33 | 25 |
|
34 | | -#Install ANACONDA Environment |
35 | | -RUN conda create -y -n jupyter_env python=3.6 nb_conda_kernels py-xgboost-gpu \ |
36 | | -anaconda ipykernel tensorflow-gpu keras-gpu matplotlib numpy scipy pandas \ |
37 | | -Pillow pydot munch scikit-learn && \ |
38 | | -/opt/conda/envs/jupyter_env/bin/pip install jupyter-tensorboard gitless opencv-python && \ |
39 | | -/opt/conda/envs/jupyter_env/bin/python -m ipykernel.kernelspec |
40 | | - |
41 | | -RUN conda create -y -n jupyter_env27 python=2.7 nb_conda_kernels py-xgboost-gpu \ |
42 | | -anaconda ipykernel tensorflow-gpu keras-gpu matplotlib numpy scipy pandas \ |
43 | | -Pillow pydot munch scikit-learn && \ |
44 | | -/opt/conda/envs/jupyter_env27/bin/pip install jupyter-tensorboard gitless opencv-python && \ |
45 | | -/opt/conda/envs/jupyter_env27/bin/python -m ipykernel.kernelspec |
| 26 | +# CREATE ENV and INSTALL |
| 27 | +RUN conda create -y -n jupyter_env python nb_conda_kernels py-xgboost-gpu \ |
| 28 | + anaconda ipykernel tensorflow-gpu keras-gpu matplotlib numpy scipy pandas \ |
| 29 | + Pillow pydot munch scikit-learn future \ |
| 30 | + && /opt/conda/envs/jupyter_env/bin/pip install jupytext jupyter-tensorboard \ |
| 31 | + gitless opencv-python tensorflow-gpu==2.4.1 \ |
| 32 | + && /opt/conda/envs/jupyter_env/bin/python -m ipykernel.kernelspec |
46 | 33 |
|
47 | 34 | # Install OpenCV |
48 | 35 | RUN apt-get update && apt-get install -y libopencv-dev && \ |
49 | 36 | echo 'ln /dev/null /dev/raw1394' >> ~/.bashrc |
50 | 37 |
|
| 38 | +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - |
| 39 | +ENV PATH $HOME/.poetry/bin:$PATH |
| 40 | + |
51 | 41 | RUN set -x \ |
52 | 42 | && cd /tmp \ |
53 | 43 | && wget https://github.com/sdg-mit/gitless/releases/download/v0.8.8/gl-v0.8.8-linux-x86_64.tar.gz \ |
54 | 44 | && tar -C /usr/bin/ -xvf gl-v0.8.8-linux-x86_64.tar.gz --strip-components=1 \ |
55 | 45 | && rm -f gl-v0.8.8-linux-x86_64.tar.gz |
56 | 46 |
|
57 | 47 | COPY docker_deps/entrypoint.sh /root/ |
| 48 | +COPY tests/test_libraries.py /tmp/ |
58 | 49 | COPY configs/jupyter_notebook_config.py /root/.jupyter/ |
59 | 50 |
|
60 | | -RUN chmod +x /root/entrypoint.sh |
| 51 | +RUN chmod +x /root/entrypoint.sh && \ |
| 52 | +chown -R 777 /tmp/test_libraries.py |
61 | 53 |
|
62 | | -ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 |
63 | | -ENV PYTHONPATH='/mnt/home/research/:/mnt/home/:$PYTHONPATH' |
64 | | -ENV PASSWORD unknownknowns |
65 | | -ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH |
| 54 | +RUN mkdir /var/run/sshd \ |
| 55 | + && echo 'root:jupyter-data-science' | chpasswd \ |
| 56 | + && sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config \ |
| 57 | + && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ |
| 58 | + && echo "export VISIBLE=now" >> /etc/profile |
| 59 | +ENV NOTVISIBLE "in users profile" |
| 60 | + |
| 61 | +RUN useradd -rm -d /home/science -s /bin/bash -g root -G sudo -u 1000 science \ |
| 62 | + && echo 'science:jupyter-data-science' | chpasswd |
| 63 | + |
| 64 | +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 \ |
| 65 | + PYTHONPATH='/mnt/home/research/:/mnt/home/:$PYTHONPATH' \ |
| 66 | + PASSWORD=jupyter-data-science \ |
| 67 | + LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
66 | 68 |
|
67 | 69 | WORKDIR /mnt/home/ |
68 | 70 |
|
69 | | -# IPython |
70 | | -EXPOSE 8888 6006 |
| 71 | +# Jupyter + Tensorboard + SSHD |
| 72 | +EXPOSE 8888 6006 22 |
71 | 73 |
|
72 | 74 | CMD bash /root/entrypoint.sh |
| 75 | + |
| 76 | + |
0 commit comments