Skip to content

Commit bd36a5d

Browse files
authored
Merge pull request #1539 from oesteban/tst/Docker
[TST] Add base and conda docker images #1536
2 parents 826ef99 + 57bf3cc commit bd36a5d

File tree

3 files changed

+236
-0
lines changed

3 files changed

+236
-0
lines changed

docker/test-image-base/Dockerfile

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Copyright (c) 2016, The developers of the Stanford CRN
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM ubuntu:vivid
30+
MAINTAINER Stanford Center for Reproducible Neuroscience <[email protected]>
31+
32+
# Preparations
33+
RUN ln -snf /bin/bash /bin/sh
34+
ARG DEBIAN_FRONTEND=noninteractive
35+
36+
# Update packages and install the minimal set of tools
37+
RUN apt-get update && \
38+
apt-get install -y curl \
39+
git \
40+
xvfb \
41+
bzip2 \
42+
unzip \
43+
apt-utils \
44+
gfortran \
45+
fusefat \
46+
liblapack-dev \
47+
libblas-dev \
48+
libatlas-dev \
49+
libatlas-base-dev \
50+
libblas3 \
51+
libblas-common \
52+
libopenblas-dev \
53+
libxml2-dev \
54+
libxslt1-dev \
55+
libfreetype6-dev \
56+
libpng12-dev \
57+
libqhull-dev \
58+
libxft-dev \
59+
libjpeg-dev \
60+
libyaml-dev
61+
62+
63+
# Install ANTs
64+
RUN mkdir -p /opt/ants && \
65+
curl -sSL "https://2a353b13e8d2d9ac21ce543b7064482f771ce658.googledrive.com/host/0BxI12kyv2olZVFhUcGVpYWF3R3c/ANTs-Linux_Ubuntu14.04.tar.bz2" \
66+
| tar -xjC /opt/ants --strip-components 1
67+
ENV ANTSPATH /opt/ants
68+
ENV PATH $ANTSPATH:$PATH
69+
70+
# Enable neurodebian
71+
RUN curl -sSL http://neuro.debian.net/lists/vivid.de-m.full | tee /etc/apt/sources.list.d/neurodebian.sources.list && \
72+
curl -sSL http://neuro.debian.net/lists/vivid.us-tn.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
73+
apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \
74+
apt-get update && \
75+
apt-get install -y fsl-core afni
76+
77+
RUN echo '#!/bin/bash' > /etc/profile.d/nipype_deps.sh && \
78+
echo 'export ANTSPATH=/opt/ants' >> /etc/profile.d/nipype_deps.sh && \
79+
echo 'export PATH=$ANTSPATH:$PATH' >> /etc/profile.d/nipype_deps.sh && \
80+
echo 'source /etc/fsl/fsl.sh' >> /etc/profile.d/nipype_deps.sh && \
81+
echo 'source /etc/afni/afni.sh' >> /etc/profile.d/nipype_deps.sh
82+
83+
# Clear apt cache to reduce image size
84+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
85+
86+
# Install Matlab: from the good old install_spm_mcr.sh of @chrisfilo
87+
WORKDIR /root
88+
89+
RUN echo "destinationFolder=/root/mcr" > mcr_options.txt && \
90+
echo "agreeToLicense=yes" >> mcr_options.txt && \
91+
echo "outputFile=/tmp/matlabinstall_log" >> mcr_options.txt && \
92+
echo "mode=silent" >> mcr_options.txt && \
93+
mkdir -p matlab_installer && \
94+
curl -sSL http://www.mathworks.com/supportfiles/downloads/R2015a/deployment_files/R2015a/installers/glnxa64/MCR_R2015a_glnxa64_installer.zip \
95+
-o matlab_installer/installer.zip && \
96+
unzip matlab_installer/installer.zip -d matlab_installer/ && \
97+
matlab_installer/install -inputFile mcr_options.txt && \
98+
rm -rf matlab_installer mcr_options.txt && \
99+
echo 'export LD_LIBRARY_PATH=/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH' >> /etc/profile.d/nipype_deps.sh && \
100+
echo 'export SPMMCRCMD="/root/spm12/run_spm12.sh /root/mcr/v85/ script"' >> /etc/profile.d/nipype_deps.sh && \
101+
echo 'export FORCE_SPMMCR=1' >> /etc/profile.d/nipype_deps.sh
102+
103+
ENV LD_LIBRARY_PATH "/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH"
104+
ENV SPMMCRCMD "/root/spm12/run_spm12.sh /root/mcr/v85/ script"
105+
ENV FORCE_SPMMCR 1
106+
107+
# Install SPM
108+
RUN curl -sSL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_r6472_Linux_R2015a.zip -o spm12.zip && \
109+
unzip spm12.zip && \
110+
rm -rf spm12.zip
111+
112+
RUN echo "source /etc/profile.d/nipype_deps.sh" >> /etc/bash.bashrc
113+
114+
CMD ["/bin/bash"]
115+

docker/test-image-nipype/Dockerfile

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (c) 2016, The developers of the Stanford CRN
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM nipype/testbase
30+
MAINTAINER Stanford Center for Reproducible Neuroscience <[email protected]>
31+
32+
# Preparations
33+
RUN ln -snf /bin/bash /bin/sh
34+
WORKDIR /root
35+
36+
# Install miniconda
37+
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh && \
38+
/bin/bash Miniconda-latest-Linux-x86_64.sh -b -p /usr/local/miniconda && \
39+
rm Miniconda-latest-Linux-x86_64.sh && \
40+
echo '#!/bin/bash' >> /etc/profile.d/nipype.sh && \
41+
echo 'export PATH=/usr/local/miniconda/bin:$PATH' >> /etc/profile.d/nipype.sh
42+
43+
ENV PATH /usr/local/miniconda/bin:$PATH
44+
45+
# http://bugs.python.org/issue19846
46+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
47+
ENV LANG C.UTF-8
48+
49+
# Add conda-forge channel in conda
50+
RUN conda config --add channels conda-forge
51+
52+
# Create conda environment
53+
RUN conda create -y -n nipypetests-2.7 lockfile nipype && \
54+
echo '#!/bin/bash' >> /etc/profile.d/nipype.sh && \
55+
echo '#!/bin/bash' >> /etc/bashrc && \
56+
echo 'source activate nipypetests-2.7' >> /etc/profile.d/nipype.sh && \
57+
echo 'source activate nipypetests-2.7' >> /etc/bashrc
58+
59+
# Create conda environment
60+
RUN conda create -y -n nipypetests-3.4 lockfile nipype python=3.4
61+
62+
# Create conda environment
63+
RUN conda create -y -n nipypetests-3.5 lockfile nipype python=3.5
64+
65+
# Install pip
66+
# RUN source activate nipypetests-2.7 && \
67+
# pip install --upgrade pip && \
68+
69+
RUN echo "source /etc/profile.d/nipype.sh" >> /etc/bash.bashrc
70+
CMD ["/bin/bash"]

docker/test-image/Dockerfile

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) 2016, The developers of the Stanford CRN
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# * Redistributions in binary form must reproduce the above copyright notice,
11+
# this list of conditions and the following disclaimer in the documentation
12+
# and/or other materials provided with the distribution.
13+
#
14+
# * Neither the name of crn_base nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
FROM nipype/testnipype
30+
MAINTAINER Stanford Center for Reproducible Neuroscience <[email protected]>
31+
32+
# Preparations
33+
RUN ln -snf /bin/bash /bin/sh
34+
WORKDIR /root
35+
36+
RUN mkdir -p ~/examples/ && ln -sf /usr/share/fsl-feeds/ ~/examples/feeds
37+
RUN curl -sSL "https://dl.dropbox.com/s/jzgq2nupxyz36bp/nipype-tutorial.tar.bz2" && \
38+
tar jxvf nipype-tutorial.tar.bz2 && \
39+
mv nipype-tutorial/* ~/examples/ && \
40+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" && \
41+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" && \
42+
curl -sSL "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" && \
43+
mkdir ~/examples/fsl_course_data && \
44+
tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data && \
45+
tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data && \
46+
tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data && \
47+
echo 'export FSL_COURSE_DATA=/root/examples/fsl_course_data' >> /etc/profile.d/crn_neuro.sh && \
48+
echo 'export FSL_COURSE_DATA=/root/examples/fsl_course_data' >> /etc/bash.bashrc
49+
ENV FSL_COURSE_DATA /root/examples/fsl_course_data
50+
51+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)