-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile_matlab
136 lines (134 loc) · 6 KB
/
Dockerfile_matlab
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
# Generated by Neurodocker and Reproenv.
FROM debian:stretch-slim
ENV FORCE_SPMMCR="1" \
SPM_HTML_BROWSER="0" \
SPMMCRCMD="/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 script" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlab-compiler-runtime-2010a/v713/runtime/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/bin/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/sys/os/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/extern/bin/glnxa64" \
MATLABCMD="/opt/matlab-compiler-runtime-2010a/v713/toolbox/matlab"
RUN export TMPDIR="$(mktemp -d)" \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
ca-certificates \
curl \
libncurses5 \
libxext6 \
libxmu6 \
libxpm-dev \
libxt6 \
multiarch-support \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& _reproenv_tmppath="$(mktemp -t tmp.XXXXXXXXXX.deb)" \
&& curl -fsSL --retry 5 -o "${_reproenv_tmppath}" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \
&& apt-get install --yes -q "${_reproenv_tmppath}" \
&& rm "${_reproenv_tmppath}" \
&& apt-get update -qq \
&& apt-get install --yes --quiet --fix-missing \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Downloading MATLAB Compiler Runtime ..." \
&& curl -fL -o "$TMPDIR/MCRInstaller.bin" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin \
&& chmod +x "$TMPDIR/MCRInstaller.bin" \
&& "$TMPDIR/MCRInstaller.bin" -silent -P installLocation="/opt/matlab-compiler-runtime-2010a" \
&& rm -rf "$TMPDIR" \
&& unset TMPDIR \
# Install spm12
&& echo "Downloading standalone SPM12 ..." \
&& curl -fL -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip \
&& unzip -q /tmp/spm12.zip -d /tmp \
&& mkdir -p /opt/spm12-r7771 \
&& mv /tmp/spm12/* /opt/spm12-r7771/ \
&& chmod -R 777 /opt/spm12-r7771 \
&& rm -rf /tmp/spm* \
# Test
&& /opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
RUN node -v && npm -v && npm install -g bids-validator
RUN test "$(getent passwd neuro)" \
|| useradd --no-user-group --create-home --shell /bin/bash neuro
USER neuro
RUN mkdir code output bidspm
COPY [".,", \
"/home/neuro/bidspm/"]
# Save specification to JSON.
USER root
RUN printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "debian:stretch-slim" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"FORCE_SPMMCR": "1", \
"SPM_HTML_BROWSER": "0", \
"SPMMCRCMD": "/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 script", \
"LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlab-compiler-runtime-2010a/v713/runtime/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/bin/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/sys/os/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/extern/bin/glnxa64", \
"MATLABCMD": "/opt/matlab-compiler-runtime-2010a/v713/toolbox/matlab" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "export TMPDIR=\\"$\(mktemp -d\)\\"\\napt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libncurses5 \\\\\\n libxext6 \\\\\\n libxmu6 \\\\\\n libxpm-dev \\\\\\n libxt6 \\\\\\n multiarch-support \\\\\\n unzip\\nrm -rf /var/lib/apt/lists/*\\n_reproenv_tmppath=\\"$\(mktemp -t tmp.XXXXXXXXXX.deb\)\\"\\ncurl -fsSL --retry 5 -o \\"${_reproenv_tmppath}\\" http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb\\napt-get install --yes -q \\"${_reproenv_tmppath}\\"\\nrm \\"${_reproenv_tmppath}\\"\\napt-get update -qq\\napt-get install --yes --quiet --fix-missing\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading MATLAB Compiler Runtime ...\\"\\ncurl -fL -o \\"$TMPDIR/MCRInstaller.bin\\" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin\\nchmod +x \\"$TMPDIR/MCRInstaller.bin\\"\\n\\"$TMPDIR/MCRInstaller.bin\\" -silent -P installLocation=\\"/opt/matlab-compiler-runtime-2010a\\"\\nrm -rf \\"$TMPDIR\\"\\nunset TMPDIR\\n# Install spm12\\necho \\"Downloading standalone SPM12 ...\\"\\ncurl -fL -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip\\nunzip -q /tmp/spm12.zip -d /tmp\\nmkdir -p /opt/spm12-r7771\\nmv /tmp/spm12/* /opt/spm12-r7771/\\nchmod -R 777 /opt/spm12-r7771\\nrm -rf /tmp/spm*\\n# Test\\n/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"nodejs", \
"npm" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n npm \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "node -v && npm -v && npm install -g bids-validator" \
} \
}, \
{ \
"name": "user", \
"kwds": { \
"user": "neuro" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir code output bidspm" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
".,", \
"/home/neuro/bidspm/" \
], \
"destination": "/home/neuro/bidspm/" \
} \
} \
] \
}' > /.reproenv.json
USER neuro
# End saving to specification to JSON.