From 629e2ecc71f5892181893b22beaa64de117a501e Mon Sep 17 00:00:00 2001 From: Pat Gunn Date: Tue, 12 Feb 2019 14:54:50 -0500 Subject: [PATCH 1/4] Provide a modern Dockerfile --- Dockerfile | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 842c1769d..30fb4f28d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,7 @@ -FROM ubuntu +FROM continuumio/anaconda3 -RUN apt-get update -RUN apt-get install -y libglib2.0-0 -RUN apt-get install -y git wget -RUN apt-get install bzip2 -RUN apt-get install -y gcc -RUN apt-get install -y g++ -RUN apt-get install -y libgtk2.0-0 -RUN apt-get install -y xvfb -RUN export MINICONDA=$HOME/miniconda -RUN export PATH="$MINICONDA/bin:$PATH" -RUN hash -r -RUN wget -q https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.5.0-Linux-x86_64.sh -O anaconda.sh -# RUN bash anaconda.sh -b -p $ANACONDA -RUN bash anaconda.sh -p /anaconda -b -ENV PATH=/anaconda/bin:${PATH} RUN conda config --set always_yes yes RUN conda update --yes conda -RUN conda info -a -RUN CONDA_SSL_VERIFY=false conda update pyopenssl -# RUN conda install -c menpo opencv3=3.1.0 -# RUN conda install -c cvxgrp cvxpy -# RUN conda install -c https://conda.anaconda.org/conda-forge tifffile -# RUN git clone --recursive -b agiovann-master https://github.com/valentina-s/Constrained_NMF.git -# RUN git clone --recursive https://github.com/agiovann/Constrained_NMF.git -# RUN git clone --recursive -b dev https://github.com/agiovann/Constrained_NMF.git -ADD . /CaImAn -WORKDIR /CaImAn/ -RUN conda env update -f environment.yml -n root -#RUN conda install --file requirements_conda.txt -#RUN pip install -r requirements_pip.txt -RUN apt-get install libc6-i386 -RUN apt-get install -y libsm6 libxrender1 -RUN conda install pyqt=4.11.4 -RUN python setup.py install -RUN python setup.py build_ext -i +RUN mkdir src && cd src && git clone -b dev git@github.com:flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && conda activate caiman && pip install . +RUN conda activate caiman && caimanmanager.py install -# RUN nosetests - -EXPOSE 8080 From b03c77b759bc4caea6b9b08a41664ba67300ebdb Mon Sep 17 00:00:00 2001 From: Pat Gunn Date: Tue, 12 Feb 2019 17:29:36 -0500 Subject: [PATCH 2/4] Inside docker, must not rely on git credentials. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 30fb4f28d..3a7edcc5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM continuumio/anaconda3 RUN conda config --set always_yes yes RUN conda update --yes conda -RUN mkdir src && cd src && git clone -b dev git@github.com:flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && conda activate caiman && pip install . +RUN mkdir src && cd src && git clone -b dev https://github.com/flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && conda activate caiman && pip install . RUN conda activate caiman && caimanmanager.py install From b10d147d23866ba4c10bd7b3d91760d31566620f Mon Sep 17 00:00:00 2001 From: Pat Gunn Date: Tue, 12 Feb 2019 17:35:14 -0500 Subject: [PATCH 3/4] Dockerfile: continuumio/anaconda3 is not installed in a modern way; adapt --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a7edcc5f..1ce0e669d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM continuumio/anaconda3 RUN conda config --set always_yes yes RUN conda update --yes conda -RUN mkdir src && cd src && git clone -b dev https://github.com/flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && conda activate caiman && pip install . -RUN conda activate caiman && caimanmanager.py install +RUN mkdir src && cd src && git clone -b dev https://github.com/flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && source activate caiman && pip install . +RUN source activate caiman && caimanmanager.py install From 0c3b07d694229056ef6f26a70f840821280d1ab9 Mon Sep 17 00:00:00 2001 From: Pat Gunn Date: Tue, 12 Feb 2019 18:55:43 -0500 Subject: [PATCH 4/4] This dockerfile finally builds correctly. --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ce0e669d..473576ad4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM continuumio/anaconda3 RUN conda config --set always_yes yes RUN conda update --yes conda -RUN mkdir src && cd src && git clone -b dev https://github.com/flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && source activate caiman && pip install . -RUN source activate caiman && caimanmanager.py install +RUN apt-get install -y gcc g++ libgl1 +RUN mkdir src && cd src && git clone -b dev https://github.com/flatironinstitute/CaImAn.git && cd CaImAn && conda env create -n caiman -f environment.yml && conda install --override-channels -c conda-forge -n caiman pip +RUN /bin/bash -c "cd src/CaImAn && source activate caiman && /opt/conda/envs/caiman/bin/pip install ." +RUN /bin/bash -c "source activate caiman && caimanmanager.py install"