forked from MIC-DKFZ/TractSeg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_CPU
executable file
·100 lines (83 loc) · 3.3 KB
/
Dockerfile_CPU
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
# Generated by Neurodocker version 0.4.0
# Timestamp: 2018-06-22 09:08:27 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
# https://github.com/kaczmarj/neurodocker
FROM neurodebian:stretch-non-free
ARG DEBIAN_FRONTEND="noninteractive"
ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG="en_US.UTF-8" \
&& chmod 777 /opt && chmod a+s /opt \
&& mkdir -p /neurodocker \
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
ENTRYPOINT ["/neurodocker/startup.sh"]
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
fsl-core \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN sed -i '$isource /etc/fsl/fsl.sh' $ND_ENTRYPOINT
RUN echo '{ \
\n "pkg_manager": "apt", \
\n "instructions": [ \
\n [ \
\n "base", \
\n "neurodebian:stretch-non-free" \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "fsl-core" \
\n ] \
\n ], \
\n [ \
\n "add_to_entrypoint", \
\n "source /etc/fsl/fsl.sh" \
\n ] \
\n ] \
\n}' > /neurodocker/neurodocker_specs.json
RUN apt-get update \
&& apt-get -y install git g++ python python-numpy libeigen3-dev zlib1g-dev libqt4-opengl-dev libgl1-mesa-dev libfftw3-dev libtiff5-dev curl \
&& apt-get -y install git-core python-setuptools python-dev build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN easy_install pip \
&& pip install wheel numpy scipy nilearn matplotlib scikit-image nibabel \
&& pip install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl
RUN mkdir -p ~/.tractseg \
&& mkdir -p /code \
&& curl -SL -o /code/mrtrix3_RC3.tar.gz https://zenodo.org/record/1415322/files/mrtrix3_RC3.tar.gz?download=1
RUN tar -zxvf /code/mrtrix3_RC3.tar.gz -C code \
&& /code/mrtrix3/set_path
# Uncomment if we want to rebuild the following commands (otherwise using cache)
#RUN echo "rebuild"
RUN pip install --upgrade https://github.com/MIC-DKFZ/TractSeg/archive/master.zip
# Sometimes fails if running everything from cache -> uncomment line "RUN echo 'rebuild'"
RUN download_all_pretrained_weights
# Does not work -> added mrtrix to path in python
ENV PATH /code/mrtrix3/bin:$PATH
# Using this we can avoid having to call TractSeg each time -> but has problems finding bet then
#ENTRYPOINT ["TractSeg"]