-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile_head
More file actions
128 lines (108 loc) · 5.24 KB
/
Dockerfile_head
File metadata and controls
128 lines (108 loc) · 5.24 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
########################################################################
### This top portion adapted from Chris Markiewicz (Github: effigies)
FROM ubuntu:xenial-20200114
# Pre-cache neurodebian key
COPY neurodebian.gpg /usr/local/etc/neurodebian.gpg
# Prepare environment
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
xvfb \
build-essential \
autoconf \
libtool \
pkg-config \
git && \
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get install -y --no-install-recommends \
nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
########################################################################
# Install latest pandoc
RUN curl -o pandoc-2.2.2.1-1-amd64.deb -sSL "https://github.com/jgm/pandoc/releases/download/2.2.2.1/pandoc-2.2.2.1-1-amd64.deb" && \
dpkg -i pandoc-2.2.2.1-1-amd64.deb && \
rm pandoc-2.2.2.1-1-amd64.deb
RUN apt-get -y update --fix-missing && apt-get install -y \
libxt6 \
unzip \
wget \
imagemagick
ENV PATH="/usr/local/miniconda/bin:$PATH"
RUN curl -fsSL -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh && \
bash miniconda.sh -b -p /usr/local/miniconda && \
rm miniconda.sh && \
conda config --add channels conda-forge && \
conda install -y numpy=1.18.1 nibabel=3.0.2 setuptools=45.2.0 && sync && \
conda clean -tip && sync && \
/usr/local/miniconda/bin/pip install --no-cache-dir pybids==0.6.5 && \
/usr/local/miniconda/bin/pip install --no-cache-dir grabbit && \
/usr/local/miniconda/bin/pip install --no-cache-dir duecredit
RUN conda install -y -c anaconda statsmodels
# install MCR 2023a
RUN mkdir mcr_install && \
cd mcr_install && \
wget https://ssd.mathworks.com/supportfiles/downloads/R2023a/Release/2/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2023a_Update_2_glnxa64.zip && \
unzip MATLAB_Runtime_R2023a_Update_2_glnxa64.zip && \
./install -agreeToLicense yes && \
cd / && \
rm -rf mcr_install
ENV BrainSuiteMCR="/usr/local/MATLAB/MATLAB_Runtime/R2023a/"
ENV PYTHONPATH=""
# Nipype
RUN pip install importlib-metadata==4.6.3
RUN git config --global core.compression 0
RUN git clone https://github.com/nipy/nipype && \
cd nipype && \
git checkout bdb7afc && \
pip install -r requirements.txt && \
python setup.py develop
# Neurodebian
RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key add /usr/local/etc/neurodebian.gpg && \
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
# FSL and AFNI
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fsl-core=5.0.9-5~nd16.04+1 \
fsl-mni152-templates=5.0.7-2 \
afni=16.2.07~dfsg.1-5~nd16.04+1
## Install the validator
RUN apt-get update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get remove -y curl && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip uninstall -y pandas && \
pip install pandas==1.1.5
RUN pip install tqdm==4.62.3 nilearn==0.8.1 basemap
RUN npm install -g bids-validator
RUN apt-get update && apt-get install -y --no-install-recommends gfortran
RUN apt-get install -y pandoc software-properties-common
RUN cd / && wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
RUN chmod -R ugo+rx /jq-linux64
# Set up R environment for bstr
RUN apt-get update && add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" && \
apt-get update && \
apt-get install dirmngr \
libzmq3-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev \
libpng-dev libtiff5-dev libjpeg-dev build-essential \
libcurl4-openssl-dev libxml2-dev libssl-dev libfontconfig1-dev cmake \
r-base -y --assume-yes --allow-unauthenticated
RUN Rscript -e "install.packages(c('iterators', 'magrittr', 'gtable', 'htmlwidgets', 'jsonlite', 'pander', 'rmarkdown', 'DT', 'ini', 'RColorBrewer', 'RNifti', 'ggplot2', 'scales', 'doParallel', 'foreach', 'bit', 'Matrix', 'R6', 'shinyjs', 'lme4'), repos='http://cran.us.r-project.org')"
RUN pip install rpy2==3.4.5
# Set up fsl eddy and eddyqc
RUN conda config --set default_threads 6
RUN conda install -y -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ fsl-eddy
RUN conda install -y -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ fsl-eddy_qc=v1.2.3
ENV FSLDIR6=/usr/local/miniconda/
ENV FSLOUTPUTTYPE=NIFTI_GZ
RUN sed -i 's/FSLDIR/FSLDIR6/' ${FSLDIR6}/bin/fslpython
RUN sed -i 's/FSLDIR/FSLDIR6/' ${FSLDIR6}/bin/eddy
# Configure lib gcc and lib mesa for renderdfs
RUN apt-get install -y xvfb libosmesa6-dev
RUN cd /usr/lib/x86_64-linux-gnu && rm libstdc++.so.6 && ln -s /usr/local/miniconda/lib/libstdc++.so.6 ./libstdc++.so.6
# downgrade scipy to 1.2 for statsmodels
RUN pip install scipy==1.2 --upgrade