Switch to unified view

a b/deeplearn-approach/docker/Dockerfile.gpu
1
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04
2
MAINTAINER Fernando Andreotti <fernando.andreotti@eng.ox.ac.uk>
3
4
# Versions used for some packages
5
ARG CONDA_VERSION=4.3.1
6
ARG CONDA_ENV
7
ARG TENSORFLOW_VERSION=1.4*
8
ARG KERAS_VERSION=2.0.9
9
ARG PYTHON_VERSION=3.5
10
11
12
ENTRYPOINT ["/bin/bash", "-c" ]
13
14
USER root
15
16
RUN echo -e "\n**********************\nNVIDIA Driver Version\n**********************\n" && \
17
    cat /proc/driver/nvidia/version && \
18
    echo -e "\n**********************\nCUDA Version\n**********************\n" && \
19
    nvcc -V && \
20
 echo -e "\n\nBuilding your Deep Learning Docker Image...\n"
21
22
# Install some dependencies
23
ENV DEBIAN_FRONTEND noninteractive
24
ENV CONDA_ENV_PATH /opt/miniconda
25
ENV MYCONDA_ENV "deeplearn"
26
ENV CONDA_ACTIVATE "source $CONDA_ENV_PATH/bin/activate $MYCONDA_ENV"
27
28
# install essentials
29
RUN apt-get update --fix-missing -qq \
30
     && apt-get install --no-install-recommends -y \
31
        autoconf \
32
        automake \  
33
        bc \
34
        build-essential \
35
        bzip2 \
36
        cmake \
37
        curl \
38
        g++ \
39
        gfortran \
40
        git \
41
        language-pack-en \
42
        libatlas-dev \
43
        libatlas3gf-base \
44
        libcurl4-openssl-dev \ 
45
        libffi-dev \
46
        libfreetype6-dev \
47
        libglib2.0-0 \   
48
        libhdf5-dev \
49
        liblcms2-dev \
50
        libopenblas-dev \       
51
        libssl-dev \
52
        libtiff5-dev \
53
        libtool \
54
        libwebp-dev \
55
        libzmq3-dev \
56
        make \
57
        nano \
58
        pkg-config \
59
        software-properties-common \
60
        unzip \
61
        wget \
62
        zlib1g-dev \
63
        qt5-default \
64
        libvtk6-dev \
65
        zlib1g-dev
66
67
68
# Install miniconda to /opt/miniconda
69
RUN curl -LO http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
70
RUN /bin/bash Miniconda-latest-Linux-x86_64.sh -p $CONDA_ENV_PATH -b
71
RUN rm Miniconda-latest-Linux-x86_64.sh
72
ENV PATH=$CONDA_ENV_PATH/bin:${PATH}
73
RUN conda update --quiet --yes conda
74
75
ENV PATH ${CONDA_ENV_PATH}/bin:$PATH
76
77
# Creating Anaconda environment
78
RUN conda create -y --name $MYCONDA_ENV python=${PYTHON_VERSION}
79
80
# Install Python 3 packages
81
82
RUN conda install -c conda-forge -y -n $MYCONDA_ENV\
83
    'beautifulsoup4=4.5*' \
84
    'graphviz=2.38.0' \
85
    'hdf5=1.8.17' \
86
    'h5py=2.7*' \
87
    'ipython=5.1*' \    
88
    'ipykernel=4.5*' \
89
    'ipywidgets=5.2*' \
90
    'jupyter=1.0*' \
91
    'lxml=3.8*' \
92
    'matplotlib=2.0*' \
93
    'notebook=4.3*' \
94
    'numpy=1.13*' \
95
    'pandas=0.20*' \
96
    'pillow=4.2*' \
97
    'pip=9.0*' \
98
    'pydotplus=2.0.2' \
99
    'python=3.5*' \
100
    'scipy=0.19*' \
101
    'scikit-learn=0.19*' \
102
    'scikit-image=0.13*' \
103
    'setuptools=36.3*' \
104
    'six=1.10*' \
105
    'sphinx=1.5*' \
106
    'spyder=3.2*'  && \
107
    conda clean -tipsy
108
109
# Some further python libraries
110
#RUN conda install -c conda-forge -n $MYCONDA_ENV r-r.utils r-lme4 r-nlme
111
RUN conda install -c glemaitre -n $MYCONDA_ENV imbalanced-learn
112
113
# Install TensorFlow
114
#RUN conda install -c conda-forge -n $MYCONDA_ENV tensorflow=${TENSORFLOW_VERSION}
115
RUN conda install -c conda-forge -n $MYCONDA_ENV tensorflow-gpu=${TENSORFLOW_VERSION}
116
117
# Install Keras
118
ENV KERAS_BACKEND=tensorflow
119
RUN conda install -c conda-forge -n $MYCONDA_ENV keras=${KERAS_VERSION}
120
121
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
122
123
RUN conda info --envs
124
RUN sed -i 's/theano/tensorflow/g' ${CONDA_ENV_PATH}/envs/${MYCONDA_ENV}/etc/conda/activate.d/keras_activate.sh # make tensorflow default 
125
126
RUN $CONDA_ACTIVATE && pip install --upgrade pip && \
127
    pip install git+git://github.com/stared/keras-sequential-ascii.git \
128
    pydot3
129
130
###########################
131
## Finishing up details ###
132
###########################
133
134
ENV HOME /sharedfolder
135
WORKDIR /sharedfolder
136
137
# Add a notebook profile.
138
RUN mkdir -p -m 700 /sharedfolder/.jupyter/ && \
139
    echo "c.NotebookApp.ip = '*'" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
140
    echo "c.NotebookApp.port = 8888" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
141
    echo "c.NotebookApp.open_browser = False" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
142
    echo "c.MultiKernelManager.default_kernel_name = 'python3'" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
143
    echo "c.NotebookApp.allow_root = True" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
144
    echo "c.NotebookApp.password_required = False" >> /sharedfolder/.jupyter/jupyter_notebook_config.py \
145
    echo "c.NotebookApp.token = ''" >> /sharedfolder/.jupyter/jupyter_notebook_config.py
146
147
148
# Expose Ports for TensorBoard (6006), Ipython (8888)
149
EXPOSE 6006 8888
150
151
CMD ["source activate deeplearn && /bin/bash"]
152