99#
1010# Timestamp: 2020/12/02 18:33:44 UTC
1111
12- FROM macatools/macapype_env:v0.3.2
12+ FROM debian:buster
1313
1414USER root
1515
@@ -19,38 +19,206 @@ MAINTAINER David Meunier "david.meunier@univ-amu.fr"
1919
2020RUN apt-get update -qq
2121
22- ################################################## Install SPM12 as MCR
23- RUN apt-get -y install unzip xorg wget
24-
25- # Install MATLAB MCR in /opt/mcr/
26- ENV MATLAB_VERSION R2019b
27- ENV MCR_VERSION v97
28- RUN mkdir /opt/mcr_install \
29- && mkdir /opt/mcr \
30- && wget --progress=bar:force -P /opt/mcr_install https://ssd.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/Release/3/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_${MATLAB_VERSION}_Update_3_glnxa64.zip \
31- && unzip -q /opt/mcr_install/MATLAB_Runtime_${MATLAB_VERSION}_Update_3_glnxa64.zip -d /opt/mcr_install \
32- && /opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent \
33- && rm -rf /opt/mcr_install /tmp/*
34-
35- # Install SPM Standalone in /opt/spm12/
36- ENV SPM_VERSION 12
37- ENV SPM_REVISION r7771
38-
39- ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mcr/${MCR_VERSION}/runtime/glnxa64:/opt/mcr/${MCR_VERSION}/bin/glnxa64:/opt/mcr/${MCR_VERSION}/sys/os/glnxa64:/opt/mcr/${MCR_VERSION}/sys/opengl/lib/glnxa64:/opt/mcr/${MCR_VERSION}/extern/bin/glnxa64
40-
41- ENV MCR_INHIBIT_CTF_LOCK 1
42- ENV SPM_HTML_BROWSER 0
43- # Running SPM once with "function exit" tests the succesfull installation *and*
44- # extracts the ctf archive which is necessary if singularity is going to be
45- # used later on, because singularity containers are read-only.
46- # Also, set +x on the entrypoint for non-root container invocations
47- RUN wget --no-check-certificate --progress=bar:force -P /opt https://www.fil.ion.ucl.ac.uk/spm/download/restricted/bids/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \
48- && unzip -q /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip -d /opt \
49- && rm -f /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \
50- && /opt/spm${SPM_VERSION}/spm${SPM_VERSION} function exit \
51- && chmod +x /opt/spm${SPM_VERSION}/spm${SPM_VERSION}
52- ENV SPM_DIR /opt/spm${SPM_VERSION}
22+ ################################################## Neurodocker
23+ ENV LANG="en_US.UTF-8" \
24+ LC_ALL="en_US.UTF-8" \
25+ ND_ENTRYPOINT="/neurodocker/startup.sh"
26+ RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
27+ && apt-get install -y -q --no-install-recommends \
28+ apt-utils \
29+ bzip2 \
30+ ca-certificates \
31+ curl \
32+ locales \
33+ unzip \
34+ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
35+ && dpkg-reconfigure --frontend=noninteractive locales \
36+ && update-locale LANG="en_US.UTF-8" \
37+ && chmod 777 /opt && chmod a+s /opt \
38+ && mkdir -p /neurodocker \
39+ && if [ ! -f "$ND_ENTRYPOINT" ]; then \
40+ echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
41+ && echo 'set -e' >> "$ND_ENTRYPOINT" \
42+ && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
43+ && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
44+ fi \
45+ && chmod -R 777 /neurodocker && chmod a+s /neurodocker
5346
47+ ENTRYPOINT ["/neurodocker/startup.sh"]
48+
49+ RUN echo '{ \
50+ \n "pkg_manager": "apt", \
51+ \n "instructions": [ \
52+ \n [ \
53+ \n "base", \
54+ \n "debian:buster" \
55+ \n ], \
56+ \n [ \
57+ \n "ants", \
58+ \n { \
59+ \n "version": "2.4.3" \
60+ \n } \
61+ \n ], \
62+ \n [ \
63+ \n "fsl", \
64+ \n { \
65+ \n "version": "6.0.7.17" \
66+ \n } \
67+ \n ], \
68+ \n [ \
69+ \n "afni", \
70+ \n { \
71+ \n "version": "latest" \
72+ \n } \
73+ \n ]\
74+ \n ] \
75+ \n}' > /neurodocker/neurodocker_specs.json
76+
77+ ################################################## Install AFNI
78+ ENV PATH="/opt/afni-latest:$PATH" \
79+ AFNI_PLUGINPATH="/opt/afni-latest"
80+ RUN apt-get install -y -q --no-install-recommends \
81+ ed \
82+ gsl-bin \
83+ libglib2.0-0 \
84+ libglu1-mesa-dev \
85+ libglw1-mesa \
86+ libgomp1 \
87+ libjpeg62 \
88+ libxm4 \
89+ multiarch-support \
90+ netpbm \
91+ tcsh \
92+ xfonts-base \
93+ xvfb
94+ RUN curl -sSL --retry 5 -o /tmp/toinstall.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb
95+ RUN dpkg -i /tmp/toinstall.deb
96+ RUN rm /tmp/toinstall.deb
97+ RUN apt-get install -f
98+ RUN gsl2_path="$(find / -name 'libgsl.so.23' || printf '')"
99+ RUN if [ -n "$gsl2_path" ]; then \
100+ ln -sfv "$gsl2_path" "$(dirname $gsl2_path)/libgsl.so.0";\
101+ fi
102+ RUN ldconfig
103+ RUN echo "Downloading AFNI ..."
104+ RUN mkdir -p /opt/afni-latest
105+ RUN curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \
106+ | tar -xz -C /opt/afni-latest --strip-components 1
107+
108+ ############################################# AFNI IsoSurface requires specifically libXp6
109+ #RUN echo 'deb http://security.ubuntu.com/ubuntu precise-security main' >> /etc/apt/sources.list
110+ #RUN apt update
111+ #RUN apt install libxp6
112+
113+ RUN ls -l /usr/lib/x86_64-linux-gnu
114+ RUN ln -s /usr/lib/x86_64-linux-gnu/libXpm.so.4.11.0 /usr/lib/x86_64-linux-gnu/libXp.so.6
115+
116+ ################################################## Install ANTS
117+ ENV ANTSPATH="/opt/ants-2.4.3/" \
118+ PATH="/opt/ants-2.4.3:$PATH"
119+ RUN apt-get update -qq \
120+ && apt-get install -y -q --no-install-recommends \
121+ ca-certificates \
122+ curl \
123+ unzip \
124+ && rm -rf /var/lib/apt/lists/* \
125+ && echo "Downloading ANTs ..." \
126+ && curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip \
127+ && unzip ants.zip -d /opt \
128+ && mv /opt/ants-2.4.3/bin/* /opt/ants-2.4.3 \
129+ && rm ants.zip
130+
131+ ######################## NiftiReg
132+ RUN apt-get update -qq
133+ RUN apt-get install --yes --no-install-recommends \
134+ ca-certificates cmake gcc g++ git make
135+
136+ RUN git clone https://github.com/KCL-BMEIS/niftyreg.git /tmp/niftyreg-src \
137+ && mkdir /tmp/niftyreg-build \
138+ && cd /tmp/niftyreg-build \
139+ && cmake -DCMAKE_INSTALL_PREFIX=/opt/niftyreg /tmp/niftyreg-src \
140+ && make \
141+ && make install
142+ ENV PATH=/opt/niftyreg/bin:$PATH
143+
144+
145+ ####################### new: python 3.10
146+
147+ RUN apt-get install -y -q wget build-essential libncursesw5-dev libssl-dev \
148+ libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
149+
150+ RUN wget https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tgz
151+ RUN tar xzf Python-3.10.8.tgz
152+ #RUN cd Python-3.10.8
153+ #RUN echo $(pwd)
154+ RUN Python-3.10.8/configure --enable-optimizations
155+ #RUN Python-3.10.8/make altinstall
156+ RUN apt-get install zlib1g-dev
157+ RUN make altinstall
158+
159+ RUN echo $(which python3.10)
160+
161+ RUN echo $(python3.10 -V )
162+
163+ RUN echo ""
164+ RUN echo $(which pip3.10)
165+ RUN echo $(pip3.10 -V )
166+
167+ RUN echo $(which pip3.10)
168+ RUN echo $(pip3.10 -V )
169+
170+ RUN echo $(which python3.10) && \
171+ ln -s /usr/local/bin/python3.10 /usr/bin/python && \
172+ ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip3 && \
173+ ln -s /usr/local/bin/pip3 /usr/local/bin/pip && \
174+ ln -s /usr/local/bin/pip /usr/bin/pip
175+
176+ RUN echo $(python -m ssl)
177+
178+ RUN echo $(which python)
179+ RUN echo $(python -V )
180+
181+ RUN echo $(which pip)
182+
183+ # specific problems with pillow
184+ RUN apt-get install -y python3-pil python3-pil.imagetk
185+
186+ RUN python -m pip install -U pillow
187+ #RUN pip install -U pillow
188+ RUN python -c "import PIL; print(PIL.__version__)"
189+
190+ ################################################## Install FSL
191+
192+ ENV FSLDIR "/usr/local/fsl"
193+ ENV DEBIAN_FRONTEND "noninteractive"
194+ ENV LANG "en_GB.UTF-8"
195+
196+ RUN apt update -y && \
197+ apt upgrade -y && \
198+ apt install -y \
199+ wget \
200+ file \
201+ bc \
202+ dc \
203+ mesa-utils \
204+ pulseaudio \
205+ libquadmath0 \
206+ libgtk2.0-0 \
207+ libgomp1
208+
209+ RUN wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py
210+ RUN python -m pip install readline
211+ RUN python ./fslinstaller.py -d /usr/local/fsl/
212+
213+ ENV PATH="${PATH}:${FSLDIR}/bin"\
214+ FSLOUTPUTTYPE="NIFTI_GZ" \
215+ FSLMULTIFILEQUIT="TRUE" \
216+ FSLTCLSH="${FSLDIR}/bin/fsltclsh" \
217+ FSLWISH="${FSLDIR}/bin/fslwish" \
218+ FSLLOCKDIR="" \
219+ FSLMACHINELIST="" \
220+ FSLREMOTECALL="" \
221+ FSLGECUDAQ="cuda.q"
54222
55223################################################## Finishing
56224RUN apt-get clean \
0 commit comments