Skip to content

Commit f711e48

Browse files
committed
MAINT: Container images - cleanup $HOME in docker build
Close #1648
1 parent 2ee9723 commit f711e48

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ RUN mkdir -p $ANTSPATH && \
9999
| tar -xzC $ANTSPATH --strip-components 1
100100
ENV PATH=$ANTSPATH:$PATH
101101

102-
# Create a shared $HOME directory
103-
RUN useradd -m -s /bin/bash -G users fmriprep
104-
WORKDIR /home/fmriprep
105-
ENV HOME="/home/fmriprep"
106-
107102
# Installing SVGO
108103
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
109104
RUN apt-get install -y nodejs
@@ -117,7 +112,6 @@ RUN mkdir -p /opt/ICA-AROMA && \
117112
curl -sSL "https://github.com/maartenmennes/ICA-AROMA/archive/v0.4.4-beta.tar.gz" \
118113
| tar -xzC /opt/ICA-AROMA --strip-components 1 && \
119114
chmod +x /opt/ICA-AROMA/ICA_AROMA.py
120-
121115
ENV PATH=/opt/ICA-AROMA:$PATH
122116

123117
# Installing and setting up miniconda
@@ -157,6 +151,11 @@ RUN conda install -y python=3.7.1 \
157151
ENV MKL_NUM_THREADS=1 \
158152
OMP_NUM_THREADS=1
159153

154+
# Create a shared $HOME directory
155+
RUN useradd -m -s /bin/bash -G users fmriprep
156+
WORKDIR /home/fmriprep
157+
ENV HOME="/home/fmriprep"
158+
160159
# Precaching fonts, set 'Agg' as default backend for matplotlib
161160
RUN python -c "from matplotlib import font_manager" && \
162161
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
@@ -171,6 +170,7 @@ RUN pip install --no-cache-dir "$( grep templateflow fmriprep-setup.cfg | xargs
171170
desc='brain', extension=['.nii', '.nii.gz']); \
172171
tfapi.get('MNI152NLin2009cAsym', atlas=None, extension=['.nii', '.nii.gz']); \
173172
tfapi.get('OASIS30ANTs', extension=['.nii', '.nii.gz']);" && \
173+
rm fmriprep-setup.cfg && \
174174
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
175175
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
176176

@@ -187,7 +187,8 @@ RUN install -m 0755 \
187187
/usr/local/bin/generate_reference_mask
188188

189189
RUN find $HOME -type d -exec chmod go=u {} + && \
190-
find $HOME -type f -exec chmod go=u {} +
190+
find $HOME -type f -exec chmod go=u {} + && \
191+
rm -rf $HOME/.npm $HOME/.conda $HOME/.empty
191192

192193
ENV IS_DOCKER_8395080871=1
193194

0 commit comments

Comments
 (0)