Skip to content

Commit 035c342

Browse files
committed
chore(build): Sync Dockerfile to fmriprep
1 parent 61e55a8 commit 035c342

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

Dockerfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# MIT License
44
#
5-
# Copyright (c) 2023 The NiPreps Developers
5+
# Copyright (c) The NiPreps Developers
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy
88
# of this software and associated documentation files (the "Software"), to deal
@@ -23,24 +23,26 @@
2323
# SOFTWARE.
2424

2525
# Ubuntu 22.04 LTS - Jammy
26-
ARG BASE_IMAGE=ubuntu:jammy-20230308
26+
ARG BASE_IMAGE=ubuntu:jammy-20240125
2727

2828
#
29-
# sMRIPrep wheel
29+
# Build wheel
3030
#
3131
FROM python:slim AS src
3232
RUN pip install build
3333
RUN apt-get update && \
3434
apt-get install -y --no-install-recommends git
35-
COPY . /src/smriprep
36-
RUN python -m build /src/smriprep
35+
COPY . /src
36+
RUN python -m build /src
3737

3838
#
3939
# Download stages
4040
#
4141

4242
# Utilities for downloading packages
4343
FROM ${BASE_IMAGE} as downloader
44+
# Bump the date to current to refresh curl/certificates/etc
45+
RUN echo "2023.07.20"
4446
RUN apt-get update && \
4547
apt-get install -y --no-install-recommends \
4648
binutils \
@@ -67,19 +69,30 @@ RUN mkdir /opt/workbench && \
6769

6870
# Micromamba
6971
FROM downloader as micromamba
72+
73+
# Install a C compiler to build extensions when needed.
74+
# traits<6.4 wheels are not available for Python 3.11+, but build easily.
75+
RUN apt-get update && \
76+
apt-get install -y --no-install-recommends build-essential && \
77+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
78+
7079
WORKDIR /
7180
# Bump the date to current to force update micromamba
72-
RUN echo "2023.04.05"
81+
RUN echo "2024.03.08"
7382
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
7483

7584
ENV MAMBA_ROOT_PREFIX="/opt/conda"
7685
COPY env.yml /tmp/env.yml
7786
COPY requirements.txt /tmp/requirements.txt
87+
WORKDIR /tmp
7888
RUN micromamba create -y -f /tmp/env.yml && \
7989
micromamba clean -y -a
8090

81-
ENV PATH="/opt/conda/envs/smriprep/bin:$PATH"
82-
RUN /opt/conda/envs/smriprep/bin/npm install -g svgo@^3.0 bids-validator@^1.13 && \
91+
# UV_USE_IO_URING for apparent race-condition (https://github.com/nodejs/node/issues/48444)
92+
# Check if this is still necessary when updating the base image.
93+
ENV PATH="/opt/conda/envs/smriprep/bin:$PATH" \
94+
UV_USE_IO_URING=0
95+
RUN npm install -g svgo@^3.2.0 bids-validator@^1.14.0 && \
8396
rm -r ~/.npm
8497

8598
#
@@ -179,7 +192,7 @@ ENV MKL_NUM_THREADS=1 \
179192
OMP_NUM_THREADS=1
180193

181194
# Installing SMRIPREP
182-
COPY --from=src /src/smriprep/dist/*.whl .
195+
COPY --from=src /src/dist/*.whl .
183196
RUN pip install --no-cache-dir $( ls *.whl )[telemetry,test]
184197

185198
RUN find $HOME -type d -exec chmod go=u {} + && \

0 commit comments

Comments
 (0)