Skip to content

Commit d08308a

Browse files
authored
Merge pull request #20 from mvdoc/enh/neurodocker
ENH: add bash files to generate dockerfile/singularity file with neurodocker
2 parents 47bbccf + 062e1a2 commit d08308a

File tree

3 files changed

+392
-64
lines changed

3 files changed

+392
-64
lines changed

Dockerfile

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Generated by Neurodocker version 0.4.0.dev2
2+
# Timestamp: 2018-05-12 17:03:02 UTC
3+
#
4+
# Thank you for using Neurodocker. If you discover any issues
5+
# or ways to improve this software, please submit an issue or
6+
# pull request on our GitHub repository:
7+
#
8+
# https://github.com/kaczmarj/neurodocker
9+
10+
FROM neurodebian:stretch
11+
12+
ARG DEBIAN_FRONTEND="noninteractive"
13+
14+
ENV LANG="en_US.UTF-8" \
15+
LC_ALL="en_US.UTF-8" \
16+
ND_ENTRYPOINT="/neurodocker/startup.sh"
17+
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
18+
&& apt-get update -qq \
19+
&& apt-get install -y -q --no-install-recommends \
20+
apt-utils \
21+
bzip2 \
22+
ca-certificates \
23+
curl \
24+
locales \
25+
unzip \
26+
&& apt-get clean \
27+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
28+
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
29+
&& dpkg-reconfigure --frontend=noninteractive locales \
30+
&& update-locale LANG="en_US.UTF-8" \
31+
&& chmod 777 /opt && chmod a+s /opt \
32+
&& mkdir -p /neurodocker \
33+
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
34+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
35+
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
36+
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
37+
fi \
38+
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
39+
40+
ENTRYPOINT ["/neurodocker/startup.sh"]
41+
42+
RUN apt-get update -qq \
43+
&& apt-get install -y -q --no-install-recommends \
44+
vim \
45+
wget \
46+
strace \
47+
time \
48+
ncdu \
49+
gnupg \
50+
curl \
51+
procps \
52+
datalad \
53+
git-annex-standalone \
54+
python-nipype \
55+
virtualenv \
56+
python-dcmstack \
57+
python-configparser \
58+
python-funcsigs \
59+
python-pytest \
60+
dcmtk \
61+
python-pip \
62+
python-wheel \
63+
&& apt-get clean \
64+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
65+
66+
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
67+
68+
RUN apt-get update -qq \
69+
&& apt-get install -y -q --no-install-recommends \
70+
nodejs \
71+
npm \
72+
&& apt-get clean \
73+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
74+
75+
RUN npm install -g [email protected]
76+
77+
RUN mkdir /afs /inbox
78+
79+
RUN pip install heudiconv[all]
80+
81+
ENV PATH="/opt/dcm2niix-v1.0.20180328/bin:$PATH"
82+
RUN apt-get update -qq \
83+
&& apt-get install -y -q --no-install-recommends \
84+
cmake \
85+
g++ \
86+
gcc \
87+
git \
88+
make \
89+
pigz \
90+
zlib1g-dev \
91+
&& apt-get clean \
92+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
93+
&& git clone https://github.com/rordenlab/dcm2niix /tmp/dcm2niix \
94+
&& cd /tmp/dcm2niix \
95+
&& git fetch --tags \
96+
&& git checkout v1.0.20180328 \
97+
&& mkdir /tmp/dcm2niix/build \
98+
&& cd /tmp/dcm2niix/build \
99+
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/dcm2niix-v1.0.20180328 .. \
100+
&& make \
101+
&& make install \
102+
&& rm -rf /tmp/dcm2niix
103+
104+
RUN echo '#!/bin/bash' >> /neurodocker/heudiconv.sh && echo 'if [ -z "$@" ]; then heudiconv -h; else heudiconv "$@"; fi' >> /neurodocker/heudiconv.sh && chmod +x /neurodocker/heudiconv.sh
105+
106+
RUN useradd --no-user-group --create-home --shell /bin/bash reproin
107+
USER reproin
108+
109+
ENTRYPOINT ["/neurodocker/heudiconv.sh"]
110+
111+
RUN echo '{ \
112+
\n "pkg_manager": "apt", \
113+
\n "instructions": [ \
114+
\n [ \
115+
\n "base", \
116+
\n "neurodebian:stretch" \
117+
\n ], \
118+
\n [ \
119+
\n "install", \
120+
\n [ \
121+
\n "vim", \
122+
\n "wget", \
123+
\n "strace", \
124+
\n "time", \
125+
\n "ncdu", \
126+
\n "gnupg", \
127+
\n "curl", \
128+
\n "procps", \
129+
\n "datalad", \
130+
\n "git-annex-standalone", \
131+
\n "python-nipype", \
132+
\n "virtualenv", \
133+
\n "python-dcmstack", \
134+
\n "python-configparser", \
135+
\n "python-funcsigs", \
136+
\n "python-pytest", \
137+
\n "dcmtk", \
138+
\n "python-pip", \
139+
\n "python-wheel" \
140+
\n ] \
141+
\n ], \
142+
\n [ \
143+
\n "run", \
144+
\n "curl -sL https://deb.nodesource.com/setup_6.x | bash - " \
145+
\n ], \
146+
\n [ \
147+
\n "install", \
148+
\n [ \
149+
\n "nodejs", \
150+
\n "npm" \
151+
\n ] \
152+
\n ], \
153+
\n [ \
154+
\n "run", \
155+
\n "npm install -g [email protected]" \
156+
\n ], \
157+
\n [ \
158+
\n "run", \
159+
\n "mkdir /afs /inbox" \
160+
\n ], \
161+
\n [ \
162+
\n "run", \
163+
\n "pip install heudiconv[all]" \
164+
\n ], \
165+
\n [ \
166+
\n "dcm2niix", \
167+
\n { \
168+
\n "version": "v1.0.20180328", \
169+
\n "method": "source" \
170+
\n } \
171+
\n ], \
172+
\n [ \
173+
\n "run", \
174+
\n "echo '"'"'#!/bin/bash'"'"' >> /neurodocker/heudiconv.sh && echo '"'"'if [ -z \"$@\" ]; then heudiconv -h; else heudiconv \"$@\"; fi'"'"' >> /neurodocker/heudiconv.sh && chmod +x /neurodocker/heudiconv.sh" \
175+
\n ], \
176+
\n [ \
177+
\n "user", \
178+
\n "reproin" \
179+
\n ], \
180+
\n [ \
181+
\n "entrypoint", \
182+
\n "/neurodocker/heudiconv.sh" \
183+
\n ] \
184+
\n ] \
185+
\n}' > /neurodocker/neurodocker_specs.json

0 commit comments

Comments
 (0)