Skip to content

Commit 0b93918

Browse files
committed
tweaks to speed up image build
1 parent bee71be commit 0b93918

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

docker/nipype_test/Dockerfile_py27

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,15 @@ RUN conda config --add channels conda-forge && \
5252
COPY docker/circleci/run_* /usr/bin/
5353
RUN chmod +x /usr/bin/run_*
5454

55+
# Speed up building
5556
RUN mkdir -p /root/src/nipype
56-
COPY . /root/src/nipype
57+
COPY requirements.txt /root/src/nipype/requirements.txt
58+
RUN pip install -r /root/src/nipype/requirements.txt
5759

60+
# Re-install nipype
61+
COPY . /root/src/nipype
5862
RUN rm -r /usr/local/miniconda/lib/python2.7/site-packages/nipype* && \
5963
cd /root/src/nipype && \
60-
pip install -r requirements.txt && \
6164
pip install -e .
6265

63-
# Replace imglob with Python3 compatible version
64-
RUN rm -r ${FSLDIR}/bin/imglob && \
65-
ln -s $(which fsl_imglob.py) ${FSLDIR}/bin/imglob
66-
6766
CMD ["/bin/bash"]

docker/nipype_test/Dockerfile_py34

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,21 @@ RUN conda config --add channels conda-forge && \
5454
COPY docker/circleci/run_* /usr/bin/
5555
RUN chmod +x /usr/bin/run_*
5656

57+
# Replace imglob with Python3 compatible version
58+
COPY nipype/external/fsl_imglob.py /usr/bin/fsl_imglob.py
59+
RUN rm -r ${FSLDIR}/bin/imglob && \
60+
chmod +x /usr/bin/fsl_imglob.py && \
61+
ln -s /usr/bin/fsl_imglob.py ${FSLDIR}/bin/imglob
62+
63+
# Speed up building
5764
RUN mkdir -p /root/src/nipype
58-
COPY . /root/src/nipype
65+
COPY requirements.txt /root/src/nipype/requirements.txt
66+
RUN pip install -r /root/src/nipype/requirements.txt
5967

60-
RUN rm -r /usr/local/miniconda/lib/python3.5/site-packages/nipype* && \
68+
# Re-install nipype
69+
COPY . /root/src/nipype
70+
RUN rm -r /usr/local/miniconda/lib/python3.4/site-packages/nipype* && \
6171
cd /root/src/nipype && \
62-
pip install -r requirements.txt && \
63-
pip install -e .
64-
65-
# Replace imglob with Python3 compatible version
66-
RUN rm -r ${FSLDIR}/bin/imglob && \
67-
ln -s $(which fsl_imglob.py) ${FSLDIR}/bin/imglob
72+
pip install -e .
6873

6974
CMD ["/bin/bash"]

docker/nipype_test/Dockerfile_py35

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,21 @@ RUN conda config --add channels conda-forge && \
5252
COPY docker/circleci/run_* /usr/bin/
5353
RUN chmod +x /usr/bin/run_*
5454

55+
# Replace imglob with Python3 compatible version
56+
COPY nipype/external/fsl_imglob.py /usr/bin/fsl_imglob.py
57+
RUN rm -r ${FSLDIR}/bin/imglob && \
58+
chmod +x /usr/bin/fsl_imglob.py && \
59+
ln -s /usr/bin/fsl_imglob.py ${FSLDIR}/bin/imglob
60+
61+
# Speed up building
5562
RUN mkdir -p /root/src/nipype
56-
COPY . /root/src/nipype
63+
COPY requirements.txt /root/src/nipype/requirements.txt
64+
RUN pip install -r /root/src/nipype/requirements.txt
5765

66+
# Re-install nipype
67+
COPY . /root/src/nipype
5868
RUN rm -r /usr/local/miniconda/lib/python3.5/site-packages/nipype* && \
5969
cd /root/src/nipype && \
60-
pip install -r requirements.txt && \
61-
pip install -e .
62-
63-
# Replace imglob with Python3 compatible version
64-
RUN rm -r ${FSLDIR}/bin/imglob && \
65-
ln -s $(which fsl_imglob.py) ${FSLDIR}/bin/imglob
70+
pip install -e .
6671

6772
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)