forked from neurodata/m2g
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
109 lines (85 loc) · 3.87 KB
/
Copy pathDockerfile
File metadata and controls
109 lines (85 loc) · 3.87 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM neurodata/fsl_1604:0.0.1
LABEL author="Derek Pisner"
LABEL maintainer="dpisner@utexas.edu"
#--------Environment Variables-----------------------------------------------#
ENV NDMG_URL https://github.com/neurodata/ndmg.git
ENV NDMG_ATLASES https://github.com/neurodata/neuroparc.git
ENV AFNI_URL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5a0dd9a7b83f69027512a12b
ENV LIBXP_URL http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb
ENV LIBPNG_URL http://mirrors.kernel.org/debian/pool/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb
#--------Initial Configuration-----------------------------------------------#
# download/install basic dependencies, and set up python
RUN apt-get update && \
apt-get install -y zip unzip vim git curl libglu1 python-setuptools zlib1g-dev \
git libpng-dev libfreetype6-dev pkg-config g++ vim r-base-core libgsl0-dev build-essential \
openssl
# upgrade python to solve TLS issues
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get update && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.6 python3.6-dev && \
curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN pip3 install --upgrade pip
# Get neurodebian config
RUN curl -sSL http://neuro.debian.net/lists/stretch.us-tn.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key add /root/.neurodebian.gpg && \
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \
apt-get update -qq
RUN apt-get -f install
# Configure git-lfs
RUN apt-get install -y apt-transport-https debian-archive-keyring
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && \
apt-get install -y git-lfs
# #---------AFNI INSTALL--------------------------------------------------------#
# # setup of AFNI, which provides robust modifications of many of neuroimaging
# # algorithms
RUN apt-get update -qq && apt-get install -yq --no-install-recommends ed gsl-bin libglu1-mesa-dev libglib2.0-0 libglw1-mesa fsl-atlases \
libgomp1 libjpeg62 libxm4 netpbm tcsh xfonts-base xvfb && \
libs_path=/usr/lib/x86_64-linux-gnu && \
if [ -f $libs_path/libgsl.so.19 ]; then \
ln $libs_path/libgsl.so.19 $libs_path/libgsl.so.0; \
fi
RUN mkdir -p /opt/afni && \
curl -o afni.tar.gz -sSLO "$AFNI_URL" && \
tar zxv -C /opt/afni --strip-components=1 -f afni.tar.gz && \
rm -rf afni.tar.gz
ENV PATH=/opt/afni:$PATH
#--------NDMG SETUP-----------------------------------------------------------#
# setup of python dependencies for ndmg itself, as well as file dependencies
RUN \
pip3.6 install numpy
RUN \
pip3.6 install nibabel scipy python-dateutil pandas boto3 awscli matplotlib nilearn sklearn pandas cython vtk pyvtk fury awscli requests ipython duecredit graspy scikit-image networkx
RUN \
pip3.6 install dipy==0.16.0 plotly==1.12.9 pybids==0.6.4 setuptools>=40.0 configparser>=3.7.4
WORKDIR /
RUN mkdir /data && \
chmod -R 777 /data
RUN mkdir /outputs && \
chmod -R 777 /outputs
RUN mkdir /ndmg_atlases
RUN \
git lfs clone $NDMG_ATLASES && \
mv /neuroparc/atlases /ndmg_atlases && \
rm -rf /neuroparc && \
rm -rf /ndmg_atlases/label/Human/DS* && \
rm -rf /ndmg_atlases/label/Human/pp264* && \
rm -rf /ndmg_atlases/label/Human/princeton* && \
rm -rf /ndmg_atlases/label/Human/slab* && \
rm -rf /ndmg_atlases/label/Human/hemispheric
RUN chmod -R 777 /ndmg_atlases
# Grab ndmg from deploy.
RUN git clone -b deploy $NDMG_URL /ndmg && \
cd /ndmg && \
pip3.6 install .
RUN chmod -R 777 /usr/local/bin/ndmg_bids
ENV MPLCONFIGDIR /tmp/matplotlib
ENV PYTHONWARNINGS ignore
# copy over the entrypoint script
#ADD ./.vimrc .vimrc
RUN ldconfig
# and add it as an entrypoint
ENTRYPOINT ["ndmg_bids"]