@@ -49,26 +49,30 @@ RUN locale-gen en_US.UTF-8 || true
49
49
ENV LANG="en_US.UTF-8" \
50
50
LC_ALL="en_US.UTF-8"
51
51
52
- ENV PATH /opt/conda/bin:$PATH
53
-
54
52
# Leave these args here to better use the Docker build cache
53
+ ENV CONDA_PATH="/opt/conda"
55
54
ARG CONDA_VERSION=py38_4.10.3
56
55
ARG SHA256SUM=935d72deb16e42739d69644977290395561b7a6db059b316958d97939e9bdf3d
57
56
58
57
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -O miniconda.sh && \
59
58
echo "${SHA256SUM} miniconda.sh" > miniconda.sha256 && \
60
59
sha256sum -c --status miniconda.sha256 && \
61
60
mkdir -p /opt && \
62
- sh miniconda.sh -b -p /opt/conda && \
61
+ sh miniconda.sh -b -p ${CONDA_PATH} && \
63
62
rm miniconda.sh miniconda.sha256 && \
64
- ln -s /opt/conda /etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
65
- echo ". /opt/conda /etc/profile.d/conda.sh" >> ~/.bashrc && \
63
+ ln -s ${CONDA_PATH} /etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
64
+ echo ". ${CONDA_PATH} /etc/profile.d/conda.sh" >> ~/.bashrc && \
66
65
echo "conda activate base" >> ~/.bashrc && \
67
- find /opt/conda/ -follow -type f -name '*.a' -delete && \
68
- find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
69
- /opt/conda/bin/conda clean -afy
66
+ find ${CONDA_PATH}/ -follow -type f -name '*.a' -delete && \
67
+ find ${CONDA_PATH}/ -follow -type f -name '*.js.map' -delete && \
68
+ ${CONDA_PATH}/bin/conda clean -afy
69
+
70
+ # Set CPATH for packages relying on compiled libs (e.g. indexed_gzip)
71
+ ENV PATH="${CONDA_PATH}/bin:$PATH" \
72
+ CPATH="${CONDA_PATH}/include:$CPATH" \
73
+ PYTHONNOUSERSITE=1
70
74
71
- RUN /opt/conda /bin/conda install -c conda-forge -c anaconda \
75
+ RUN ${CONDA_PATH} /bin/conda install -c conda-forge -c anaconda \
72
76
python=3.8 \
73
77
attrs=21.2 \
74
78
codecov=2.1 \
@@ -123,22 +127,22 @@ RUN /opt/conda/bin/conda install -c conda-forge -c anaconda \
123
127
traits=6.2 \
124
128
zlib=1.2 \
125
129
zstd=1.5; sync && \
126
- chmod -R a+rX /opt/conda ; sync && \
127
- chmod +x /opt/conda /bin/*; sync && \
128
- /opt/conda /bin/conda clean -afy && sync && \
130
+ chmod -R a+rX ${CONDA_PATH} ; sync && \
131
+ chmod +x ${CONDA_PATH} /bin/*; sync && \
132
+ ${CONDA_PATH} /bin/conda clean -afy && sync && \
129
133
rm -rf ~/.conda ~/.cache/pip/*; sync
130
134
131
135
# Precaching fonts, set 'Agg' as default backend for matplotlib
132
- RUN /opt/conda /bin/python -c "from matplotlib import font_manager" && \
133
- sed -i 's/\( backend *: \) .*$/\1 Agg/g' $( /opt/conda /bin/python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
136
+ RUN ${CONDA_PATH} /bin/python -c "from matplotlib import font_manager" && \
137
+ sed -i 's/\( backend *: \) .*$/\1 Agg/g' $( ${CONDA_PATH} /bin/python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
134
138
135
139
# Install packages that are not distributed with conda
136
- RUN /opt/conda /bin/python -m pip install --no-cache-dir -U \
140
+ RUN ${CONDA_PATH} /bin/python -m pip install --no-cache-dir -U \
137
141
etelemetry \
138
142
nitransforms \
139
143
templateflow \
140
144
transforms3d
141
145
142
146
# Installing SVGO and bids-validator
143
- RUN /opt/conda /bin/npm install -g svgo@^2.3 bids-validator@1.8.0 && \
147
+ RUN ${CONDA_PATH} /bin/npm install -g svgo@^2.3 bids-validator@1.8.0 && \
144
148
rm -rf ~/.npm ~/.empty /root/.npm
0 commit comments