-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile.centos7
66 lines (58 loc) · 2.75 KB
/
Dockerfile.centos7
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
FROM centos:7.5.1804
MAINTAINER Tashrif Billah <[email protected]>
# set up user and working directory
WORKDIR /
ENV USER="root"
COPY startup.sh /
## primary image for deployment ##
# libraries and commands for FSL
RUN yum -y update > /dev/null 2>&1 && \
yum -y install epel-release wget which file bzip2 openblas-devel libquadmath && \
yum clean all && \
# install FSL
echo "Downloading FSL installer" && \
wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py -O fslinstaller.py > /dev/null 2>&1 && \
echo "Installing FSL" && \
python fslinstaller.py -V 5.0.11 -d `pwd`/fsl-5.0.11-centos7 -p > /dev/null 2>&1 && \
# setup FSL environment
export FSLDIR="$PWD/fsl-5.0.11-centos7" && \
echo "export FSLDIR=$PWD/fsl-5.0.11-centos7" >> ~/.bashrc && \
export PATH="$FSLDIR/bin/:$PATH" && \
echo "export PATH=\$FSLDIR/bin/:\$PATH" >> ~/.bashrc && \
source $FSLDIR/etc/fslconf/fsl.sh && \
echo "source $FSLDIR/etc/fslconf/fsl.sh" >> ~/.bashrc && \
# apply patch
echo "Installing FSL patch" && \
$FSLDIR/fslpython/bin/conda install -y -n fslpython -c conda-forge deprecation==1.* > /dev/null 2>&1 && \
$FSLDIR/fslpython/bin/conda clean --all && \
rm -f fslinstaller.py && \
# install python
echo "Downloading miniconda3 installer" && \
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O Miniconda3-latest-Linux-x86_64.sh > /dev/null 2>&1 && \
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b -p miniconda3/ && \
rm -f Miniconda3-latest-Linux-x86_64.sh && \
source miniconda3/bin/activate && \
echo "source $PWD/miniconda3/bin/activate" >> ~/.bashrc && \
# install ANTs=2.3.0
conda install -y -c pnlbwh ants && \
export ANTSPATH="$PWD/miniconda3/bin/" && \
echo "export ANTSPATH=$PWD/miniconda3/bin/" >> ~/.bashrc && \
# libraries and commands for TBSS
yum -y install git bc unzip gcc && \
yum clean all && \
rm -rf /var/yum/cache/ && \
# clone TBSS
git clone --single-branch --branch master https://github.com/pnlbwh/tbss.git && \
# install TBSS
/bin/bash tbss/install.sh setup && \
# clear cache
conda clean -y --all && rm -rf ~/.cache/pip/* && \
# define alias
echo "alias ls=\"ls --color\"" >> ~/.bashrc && \
# clean up redundant files
cd $FSLDIR/ && rm -rf doc/ refdoc/ src/ extras/ data/first data/mist data/possum bin/FSLeyes && \
chmod +x /startup.sh
## secondary image for testing ##
# disable unittest within install.sh script, run pipeline, and remove redundant test files
RUN source ~/.bashrc && sed -i "s/pytest -v/# pytest -v/g" tbss/install.sh && tbss/install.sh test && cd tbss/lib/tests/ && for i in `find . -type f \( ! -iname "*combined_roi_avg.csv" -a ! -iname "*py" \)`; do rm $i; done
ENTRYPOINT ["/startup.sh"]