-
Notifications
You must be signed in to change notification settings - Fork 2
/
repronim-bet.Dockerfile
180 lines (166 loc) · 6.11 KB
/
repronim-bet.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Generated by Neurodocker v0.3.1-21-ged92d36.
#
# 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
#
# Timestamp: 2017-11-11 15:09:30
FROM debian:stretch
ARG DEBIAN_FRONTEND=noninteractive
#----------------------------------------------------------
# Install common dependencies and create default entrypoint
#----------------------------------------------------------
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
apt-utils bzip2 ca-certificates curl locales unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& localedef --force --inputfile=en_US --charmap=UTF-8 C.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 +x' >> $ND_ENTRYPOINT \
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
ENTRYPOINT ["/neurodocker/startup.sh"]
#-----------------------------------------------------------
# Install FSL v5.0.10
# FSL is non-free. If you are considering commerical use
# of this Docker image, please consult the relevant license:
# https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
#-----------------------------------------------------------
RUN apt-get update -qq && apt-get install -yq --no-install-recommends bc dc libfontconfig1 libfreetype6 libgl1-mesa-dev libglu1-mesa-dev libgomp1 libice6 libmng1 libxcursor1 libxft2 libxinerama1 libxrandr2 libxrender1 libxt6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading FSL ..." \
&& curl -sSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.10-centos6_64.tar.gz \
| tar zx -C /opt \
&& /bin/bash /opt/fsl/etc/fslconf/fslpython_install.sh -q -f /opt/fsl \
&& sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \
&& sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \
&& sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \
&& sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT
ENV FSLDIR=/opt/fsl \
PATH=/opt/fsl/bin:$PATH
# Create new user: neuro
RUN useradd --no-user-group --create-home --shell /bin/bash neuro
USER neuro
#------------------
# Install Miniconda
#------------------
ENV CONDA_DIR=/opt/conda \
PATH=/opt/conda/bin:$PATH
RUN echo "Downloading Miniconda installer ..." \
&& miniconda_installer=/tmp/miniconda.sh \
&& curl -sSL -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& /bin/bash $miniconda_installer -b -p $CONDA_DIR \
&& rm -f $miniconda_installer \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& conda clean -tipsy && sync
#-------------------------
# Create conda environment
#-------------------------
RUN conda create -y -q --name neuro --channel vida-nyu python=3.5.1 \
numpy \
pandas \
reprozip \
traits \
&& sync && conda clean -tipsy && sync \
&& /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir nipype" \
&& sync \
&& sed -i '$isource activate neuro' $ND_ENTRYPOINT
#-------------------------
# Update conda environment
#-------------------------
RUN /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir pylsl" \
&& sync
#-------------------------
# Create conda environment
#-------------------------
RUN conda create -y -q --name py27 python=2.7 \
&& sync && conda clean -tipsy && sync
USER root
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends git \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER neuro
WORKDIR /home/neuro
#--------------------------------------
# Save container specifications to JSON
#--------------------------------------
RUN echo '{ \
\n "pkg_manager": "apt", \
\n "check_urls": false, \
\n "instructions": [ \
\n [ \
\n "base", \
\n "debian:stretch" \
\n ], \
\n [ \
\n "fsl", \
\n { \
\n "version": "5.0.10" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "neuro", \
\n "conda_opts": "--channel vida-nyu", \
\n "conda_install": "python=3.5.1 numpy pandas reprozip traits", \
\n "pip_install": "nipype", \
\n "activate": true \
\n } \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "neuro", \
\n "pip_install": "pylsl" \
\n } \
\n ], \
\n [ \
\n "miniconda", \
\n { \
\n "env_name": "py27", \
\n "conda_install": "python=2.7" \
\n } \
\n ], \
\n [ \
\n "user", \
\n "root" \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "git", \
\n "vim" \
\n ] \
\n ], \
\n [ \
\n "user", \
\n "neuro" \
\n ], \
\n [ \
\n "workdir", \
\n "/home/neuro" \
\n ] \
\n ], \
\n "generation_timestamp": "2017-11-11 15:09:30", \
\n "neurodocker_version": "0.3.1-21-ged92d36" \
\n}' > /neurodocker/neurodocker_specs.json