-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
executable file
·88 lines (75 loc) · 2.61 KB
/
Dockerfile
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
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
# ubuntu environment setup
RUN apt-get update -y && apt-get upgrade -y &&\
apt-get install -y \
wget \
unzip \
build-essential checkinstall zlib1g-dev \
libssl-dev \
git \
dc \
ffmpeg \
libsm6 \
libxext6
RUN wget https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz &&\
tar -xvzf cmake-3.23.2.tar.gz &&\
rm cmake-3.23.2.tar.gz &&\
cd cmake-3.23.2 &&\
./bootstrap &&\
make &&\
make install
# create and switch to working directory
RUN mkdir aida/
WORKDIR /aida/
# Niftyreg preparation and installation
RUN mkdir -p NiftyReg/niftyreg_source/
WORKDIR /aida/NiftyReg
RUN git clone git://git.code.sf.net/p/niftyreg/git niftyreg_source &&\
cd niftyreg_source &&\
git reset --hard 83d8d1182ed4c227ce4764f1fdab3b1797eecd8d &&\
mkdir niftyreg_install niftyreg_build && cd .. &&\
cmake niftyreg_source &&\
cmake -D CMAKE_BUILD_TYPE=Release niftyreg_source &&\
cmake -D CMAKE_INSTALL_PREFIX=niftyreg_source/niftyreg_build niftyreg_source &&\
cmake -D CMAKE_C_COMPILER=/usr/bin/gcc-7 niftyreg_source &&\
make && make install
RUN export NIFTYRREG_INSTALL=../niftyreg_install
ENV PATH=${PATH}:${NIFTYREG_INSTALL}/bin
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NIFTYREG_INSTALL}/lib
RUN export PATH && export LD_LIBRARY_PATH
WORKDIR /aida
# download DSI studio
RUN wget https://github.com/frankyeh/DSI-Studio/releases/download/2023.07.08/dsi_studio_ubuntu1804.zip &&\
unzip dsi_studio_ubuntu1804.zip -d dsi_studio_ubuntu1804 &&\
rm dsi_studio_ubuntu1804.zip
# Python setup
RUN apt install -y python3.7 python3-pip &&\
python3 -m pip install --user --upgrade pip &&\
apt-get install -y python3.7-venv &&\
apt clean &&\
rm -rf /var/lib/apt/lists/*
ENV VIRTUAL_ENV=/opt/env
RUN python3.7 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python3 -m pip install --upgrade setuptools
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip &&\
pip install -r requirements.txt
# installation of FSL 5.0.11 with modified installer
# (disabling interactive allocation query)
COPY fslinstaller_mod.py ./
RUN python3 fslinstaller_mod.py -V 5.0.11
# Configure environment
ENV FSLDIR=/usr/local/fsl
RUN . ${FSLDIR}/etc/fslconf/fsl.sh
ENV FSLOUTPUTTYPE=NIFTI_GZ
ENV PATH=${FSLDIR}/bin:${PATH}
RUN export FSLDIR PATHs
# copy bin/ and lib/ from AIDAmri into image
COPY bin/ bin/
RUN chmod u+x bin/3.2_DTIConnectivity/dsi_main.py
ENV PATH=/aida/bin/3.2_DTIConnectivity:$PATH
RUN cp bin/3.2_DTIConnectivity/dsi_main.py dsi_main
COPY lib/ lib/
RUN echo "/aida/bin/dsi_studio_ubuntu_1804/dsi-studio/dsi_studio" > bin/3.2_DTIConnectivity/dsi_studioPath.txt