20
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
# SOFTWARE.
22
22
# Use Ubuntu 20.04 LTS
23
- FROM ubuntu:focal-20210416
23
+ FROM ubuntu:jammy-20240125
24
24
25
25
# Make apt non-interactive
26
26
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
@@ -35,6 +35,7 @@ RUN apt-get update && \
35
35
build-essential \
36
36
bzip2 \
37
37
ca-certificates \
38
+ curl \
38
39
libtool \
39
40
locales \
40
41
lsb-release \
@@ -50,102 +51,33 @@ RUN locale-gen en_US.UTF-8 || true
50
51
ENV LANG="en_US.UTF-8" \
51
52
LC_ALL="en_US.UTF-8"
52
53
53
- # Leave these args here to better use the Docker build cache
54
- # miniconda index: https://conda.io/en/latest/miniconda_hashes.html
55
- ENV CONDA_PATH="/opt/conda"
56
- ARG CONDA_VERSION=py39_23.1.0-1
57
- ARG SHA256SUM=5dc619babc1d19d6688617966251a38d245cb93d69066ccde9a013e1ebb5bf18
54
+ WORKDIR /
55
+ RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
58
56
59
- RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -O miniconda.sh && \
60
- echo "${SHA256SUM} miniconda.sh" > miniconda.sha256 && \
61
- sha256sum -c --status miniconda.sha256 && \
62
- mkdir -p /opt && \
63
- sh miniconda.sh -b -p ${CONDA_PATH} && \
64
- rm miniconda.sh miniconda.sha256 && \
65
- ln -s ${CONDA_PATH}/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
66
- echo ". ${CONDA_PATH}/etc/profile.d/conda.sh" >> ~/.bashrc && \
67
- echo "conda activate base" >> ~/.bashrc && \
68
- find ${CONDA_PATH}/ -follow -type f -name '*.a' -delete && \
69
- find ${CONDA_PATH}/ -follow -type f -name '*.js.map' -delete && \
70
- ${CONDA_PATH}/bin/conda clean -afy
71
-
72
- # Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
73
- ENV PATH="${CONDA_PATH}/bin:$PATH" \
74
- CPATH="${CONDA_PATH}/include:$CPATH" \
75
- PYTHONNOUSERSITE=1
76
-
77
- COPY condarc /root/.condarc
78
-
79
- RUN ${CONDA_PATH}/bin/conda install mamba -n base && \
80
- mamba install -y \
81
- attrs=22.2 \
82
- codecov=2.1 \
83
- colorclass=2.2 \
84
- coverage=6.3 \
85
- curl=7.88 \
86
- datalad=0.18 \
87
- dipy=1.5 \
88
- flake8=4.0 \
89
- git=2.39 \
90
- graphviz=3.0 \
91
- h5py=3.8 \
92
- indexed_gzip=1.7 \
93
- jinja2=3.1 \
94
- libxml2=2.10 \
95
- libxslt=1.1 \
96
- lockfile=0.12 \
97
- matplotlib=3.5 \
98
- mkl=2022.1 \
99
- mkl-service=2.4 \
100
- nibabel=4.0 \
101
- nilearn=0.9 \
102
- nipype=1.8 \
103
- nitime=0.9 \
104
- nodejs=18 \
105
- numpy=1.24 \
106
- packaging=23.0 \
107
- pandas=1.5 \
108
- pandoc=2.19 \
109
- pbr=5.11 \
110
- pip=23.0 \
111
- pockets=0.9 \
112
- psutil=5.9 \
113
- pydot=1.4 \
114
- pytest=7.2 \
115
- pytest-cov=4.0 \
116
- pytest-env=0.8 \
117
- pytest-xdist=3.2 \
118
- pyyaml=6.0 \
119
- requests=2.28 \
120
- scikit-image=0.19 \
121
- scikit-learn=1.2 \
122
- scipy=1.10 \
123
- seaborn=0.12 \
124
- setuptools=65 \
125
- sphinx=4.5 \
126
- sphinx_rtd_theme=1.0 \
127
- svgutils=0.3 \
128
- toml=0.10 \
129
- traits=6.3 \
130
- zlib=1.2 \
131
- zstd=1.5; sync && \
132
- chmod -R a+rX ${CONDA_PATH}; sync && \
133
- chmod +x ${CONDA_PATH}/bin/*; sync && \
134
- ${CONDA_PATH}/bin/conda clean -afy && sync && \
135
- rm -rf ~/.conda ~/.cache/pip/*; sync
57
+ ENV MAMBA_ROOT_PREFIX="/opt/conda"
58
+ COPY env.yml /tmp/env.yml
59
+ COPY requirements.txt /tmp/requirements.txt
60
+ WORKDIR /tmp
61
+ RUN micromamba create -y -f /tmp/env.yml && \
62
+ micromamba clean -y -a
136
63
137
64
# Precaching fonts, set 'Agg' as default backend for matplotlib
138
- RUN ${CONDA_PATH}/bin/ python -c "from matplotlib import font_manager" && \
139
- sed -i 's/\( backend *: \) .*$/\1 Agg/g' $( ${CONDA_PATH}/bin/ python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
65
+ RUN micromamba -n base run python -c "from matplotlib import font_manager" && \
66
+ sed -i 's/\( backend *: \) .*$/\1 Agg/g' $( micromamba -n base run python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
140
67
141
- # Install packages that are not distributed with conda
142
- RUN ${CONDA_PATH}/bin/python -m pip install --no-cache-dir -U \
143
- datalad-osf \
144
- etelemetry \
145
- nitransforms \
146
- templateflow \
147
- transforms3d
68
+ # UV_USE_IO_URING for apparent race-condition (https://github.com/nodejs/node/issues/48444)
69
+ # Check if this is still necessary when updating the base image.
70
+ ENV PATH="/opt/conda/bin:$PATH" \
71
+ UV_USE_IO_URING=0
148
72
149
73
# Installing SVGO and bids-validator
150
- RUN ${CONDA_PATH}/bin/ npm install -g svgo@^2.3 bids-validator@1.8 .0 && \
74
+ RUN npm install -g svgo@^3.2.0 bids-validator@^1.14 .0 && \
151
75
rm -rf ~/.npm ~/.empty /root/.npm
76
+
77
+ # Initialize templateflow
78
+ ENV TEMPLATEFLOW_HOME=/templateflow
79
+ RUN templateflow update
80
+
81
+ # Pacify DataLad
82
+ RUN git config --global user.name "NiPreps Miniconda" \
83
+ && git config --global user.email "nipreps@gmail.com"
0 commit comments