1
+ # Build wheel separately
2
+ FROM python:slim AS src
3
+ RUN pip install build
4
+ RUN apt-get update && \
5
+ apt-get install -y --no-install-recommends git
6
+ COPY . /src/nibabies
7
+ RUN python -m build /src/nibabies
8
+
1
9
# Ubuntu 20.04 LTS
2
- FROM ubuntu:focal-20210827
10
+ FROM ubuntu:focal-20221130
3
11
ENV DEBIAN_FRONTEND="noninteractive" \
4
12
LANG="en_US.UTF-8" \
5
13
LC_ALL="en_US.UTF-8"
6
14
7
- # Pre-cache neurodebian key
8
- COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
9
-
10
15
# Prepare environment
11
16
RUN apt-get update && \
12
17
apt-get install -y --no-install-recommends \
@@ -24,22 +29,14 @@ RUN apt-get update && \
24
29
pandoc \
25
30
pandoc-citeproc \
26
31
pkg-config \
32
+ unzip \
27
33
xvfb && \
28
34
curl -sSL https://deb.nodesource.com/setup_14.x | bash - && \
29
35
apt-get install -y --no-install-recommends \
30
36
nodejs && \
31
37
locale-gen en_US.UTF-8 && \
32
38
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
33
39
34
- # Installing Neurodebian packages (workbench, git-annex)
35
- RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
36
- apt-key add /usr/local/etc/neurodebian.gpg && \
37
- (apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
38
- RUN apt-get update && \
39
- apt-get install -y --no-install-recommends \
40
- connectome-workbench=1.5.0-1~nd20.04+1 && \
41
- apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
42
-
43
40
# Installing ANTs 2.3.4 (NeuroDocker build)
44
41
ENV ANTSPATH="/usr/lib/ants" \
45
42
PATH="/usr/lib/ants:$PATH"
@@ -221,8 +218,19 @@ ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
221
218
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
222
219
PATH="$FREESURFER_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
223
220
221
+ # Workbench
222
+ WORKDIR /opt
223
+ RUN curl -sSLO https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && \
224
+ unzip workbench-linux64-v1.5.0.zip && \
225
+ rm workbench-linux64-v1.5.0.zip && \
226
+ rm -rf /opt/workbench/libs_linux64_software_opengl /opt/workbench/plugins_linux64 && \
227
+ strip --remove-section=.note.ABI-tag /opt/workbench/libs_linux64/libQt5Core.so.5
228
+ # ABI tags can interfere when running on Singularity/Apptainer
229
+ ENV PATH="/opt/workbench/bin_linux64:$PATH" \
230
+ LD_LIBRARY_PATH="/opt/workbench/lib_linux64:$LD_LIBRARY_PATH"
231
+
224
232
# Installing SVGO and bids-validator
225
- RUN npm install -g svgo@^2.3
[email protected] .
0 \
233
+ RUN npm install -g svgo@^2.3
[email protected] .
9 \
226
234
&& rm -rf ~/.npm ~/.empty /root/.npm
227
235
228
236
# ICA AROMA
@@ -238,8 +246,8 @@ RUN useradd -m -s /bin/bash -G users nibabies
238
246
WORKDIR /home/nibabies
239
247
ENV HOME="/home/nibabies"
240
248
241
- # py39_0525.0
242
- COPY --from=nipreps/miniconda@sha256:40fffd37963502dcd8549773559fc21182f52460e59e0ad6398a84faf6055641 /opt/conda /opt/conda
249
+ # py39_2209.01
250
+ COPY --from=nipreps/miniconda@sha256:8894ca17e3c8ba963812a6876093463eab6b88871bcfe23f71ebc84cf38451db /opt/conda /opt/conda
243
251
244
252
RUN ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
245
253
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
@@ -255,32 +263,26 @@ ENV PATH="/opt/conda/bin:$PATH" \
255
263
CONDA_PYTHON="/opt/conda/bin/python"
256
264
257
265
# Precaching atlases
258
- COPY setup.cfg nibabies-setup.cfg
259
266
COPY scripts/fetch_templates.py fetch_templates.py
260
- RUN ${CONDA_PYTHON} -m pip install --no-cache-dir "$( grep templateflow nibabies-setup.cfg | xargs )" && \
267
+ RUN ${CONDA_PYTHON} -m pip install --no-cache-dir templateflow && \
261
268
${CONDA_PYTHON} fetch_templates.py && \
262
- rm nibabies-setup.cfg fetch_templates.py && \
269
+ rm fetch_templates.py && \
263
270
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
264
271
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
265
272
266
- COPY . /src/nibabies
267
- # Force static versioning within container
268
- ARG VERSION
269
- RUN echo "${VERSION}" > /src/nibabies/nibabies/VERSION && \
270
- echo "include nibabies/VERSION" >> /src/nibabies/MANIFEST.in && \
271
- ${CONDA_PYTHON} -m pip install --no-cache-dir "/src/nibabies[all]"
272
-
273
- # ABI tags can interfere when running on Singularity/Apptainer
274
- RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
273
+ # Install pre-built wheel
274
+ COPY --from=src /src/nibabies/dist/*.whl .
275
+ RUN ${CONDA_PYTHON} -m pip install --no-cache-dir $( ls *.whl )[all]
275
276
276
277
# Final settings
277
278
RUN ldconfig
278
279
WORKDIR /tmp
279
280
ARG BUILD_DATE
280
281
ARG VCS_REF
282
+ ARG VERSION
281
283
LABEL org.label-schema.build-date=$BUILD_DATE \
282
284
org.label-schema.name="nibabies" \
283
- org.label-schema.description="nibabies - NeuroImaging tools for babies" \
285
+ org.label-schema.description="NiBabies - NeuroImaging tools for babies" \
284
286
org.label-schema.url="https://github.com/nipreps/nibabies" \
285
287
org.label-schema.vcs-ref=$VCS_REF \
286
288
org.label-schema.vcs-url="https://github.com/nipreps/nibabies" \
0 commit comments