Skip to content

Commit df87400

Browse files
committed
📦 Update main Dockerfiles from develop
1 parent 7579297 commit df87400

File tree

4 files changed

+112
-29
lines changed

4 files changed

+112
-29
lines changed

Dockerfile

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,52 @@
1-
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.5.dev
1+
# Copyright (C) 2022-2023 C-PAC Developers
2+
3+
# This file is part of C-PAC.
4+
5+
# C-PAC is free software: you can redistribute it and/or modify it under
6+
# the terms of the GNU Lesser General Public License as published by the
7+
# Free Software Foundation, either version 3 of the License, or (at your
8+
# option) any later version.
9+
10+
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13+
# License for more details.
14+
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
17+
FROM ghcr.io/fcp-indi/c-pac/stage-base:standard-v1.8.6.dev1
218
LABEL org.opencontainers.image.description "Full C-PAC image"
19+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
320
USER root
421

522
# install C-PAC
623
COPY dev/circleci_data/pipe-test_ci.yml /cpac_resources/pipe-test_ci.yml
724
COPY . /code
8-
RUN pip install -e /code
25+
RUN pip cache purge && pip install -e /code
926
# set up runscript
1027
COPY dev/docker_data /code/docker_data
11-
RUN rm -Rf /code/docker_data/Dockerfiles && \
28+
RUN rm -Rf /code/docker_data/checksum && \
1229
mv /code/docker_data/* /code && \
1330
rm -Rf /code/docker_data && \
1431
chmod +x /code/run.py && \
1532
chmod +x /code/run-with-freesurfer.sh
1633
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1734

1835
# link libraries & clean up
19-
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
20-
ldconfig && \
21-
chmod 777 $(ls / | grep -v sys | grep -v proc)
36+
# link libraries & clean up
37+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/* \
38+
&& find / -type f -print0 | sort -t/ -k2 | xargs -0 rdfind -makehardlinks true \
39+
&& rm -rf results.txt \
40+
&& apt-get remove rdfind -y \
41+
&& apt-get clean \
42+
&& apt-get autoremove -y \
43+
&& ldconfig \
44+
&& chmod 777 / \
45+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
46+
ENV PYTHONUSERBASE=/home/c-pac_user/.local
47+
ENV PATH=$PATH:/home/c-pac_user/.local/bin \
48+
PYTHONPATH=$PYTHONPATH:$PYTHONUSERBASE/lib/python3.10/site-packages
2249

2350
# set user
51+
WORKDIR /home/c-pac_user
2452
# USER c-pac_user

variant-ABCD-HCP.Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
FROM ghcr.io/fcp-indi/c-pac/stage-base:abcd-hcp-v1.8.5.dev
1+
FROM ghcr.io/fcp-indi/c-pac/stage-base:abcd-hcp-v1.8.6.dev1
22
LABEL org.opencontainers.image.description "Full C-PAC image with software dependencies version-matched to [ABCD-HCP BIDS fMRI Pipeline](https://github.com/DCAN-Labs/abcd-hcp-pipeline/blob/e480a8f99534f1b05f37bf44c64827384b69b383/Dockerfile)"
3+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
34
USER root
45

56
# install C-PAC
67
COPY dev/circleci_data/pipe-test_ci.yml /cpac_resources/pipe-test_ci.yml
78
COPY . /code
8-
RUN pip install -e /code
9+
RUN pip cache purge && pip install -e /code
910
# set up runscript
1011
COPY dev/docker_data /code/docker_data
11-
RUN rm -Rf /code/docker_data/Dockerfiles && \
12+
RUN rm -Rf /code/docker_data/checksum && \
1213
mv /code/docker_data/* /code && \
1314
rm -Rf /code/docker_data && \
1415
chmod +x /code/run.py && \
1516
chmod +x /code/run-with-freesurfer.sh
1617
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1718

1819
# Link libraries for Singularity images
19-
RUN ldconfig
20-
21-
RUN apt-get clean && \
22-
apt-get autoremove -y && \
23-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
20+
RUN ldconfig \
21+
&& apt-get clean \
22+
&& apt-get autoremove -y \
23+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/pip/* \
24+
&& chmod 777 / \
25+
&& chmod -R 777 /home/c-pac_user \
26+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
27+
ENV PYTHONUSERBASE=/home/c-pac_user/.local
28+
ENV PATH=$PATH:/home/c-pac_user/.local/bin \
29+
PYTHONPATH=$PYTHONPATH:$PYTHONUSERBASE/lib/python3.10/site-packages
2430

2531
# set user
32+
WORKDIR /home/c-pac_user
2633
# USER c-pac_user

variant-fMRIPrep-LTS.Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
FROM ghcr.io/fcp-indi/c-pac/stage-base:fmriprep-lts-v1.8.5.dev
1+
FROM ghcr.io/fcp-indi/c-pac/stage-base:fmriprep-lts-v1.8.6.dev1
22
LABEL org.opencontainers.image.description "Full C-PAC image with software dependencies version-matched to [fMRIPrep LTS](https://reproducibility.stanford.edu/fmriprep-lts#long-term-support-lts)"
3+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
34
USER root
45

56
# install C-PAC & set up runscript
67
COPY dev/circleci_data/pipe-test_ci.yml /cpac_resources/pipe-test_ci.yml
78
COPY . /code
8-
RUN pip install -e /code
9+
RUN pip cache purge && pip install -e /code
910
# set up runscript
1011
COPY dev/docker_data /code/docker_data
11-
RUN rm -Rf /code/docker_data/Dockerfiles && \
12+
RUN rm -Rf /code/docker_data/checksum && \
1213
mv /code/docker_data/* /code && \
1314
rm -Rf /code/docker_data && \
1415
chmod +x /code/run.py && \
1516
chmod +x /code/run-with-freesurfer.sh
1617
ENTRYPOINT ["/code/run-with-freesurfer.sh"]
1718

1819
# link libraries & clean up
19-
RUN sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
20-
locale-gen && \
21-
apt-get clean && \
22-
apt-get autoremove -y && \
23-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
24-
ldconfig && \
25-
chmod 777 $(ls / | grep -v sys | grep -v proc)
20+
RUN sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
21+
&& locale-gen \
22+
&& apt-get clean \
23+
&& apt-get autoremove -y \
24+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/pip/* \
25+
&& ldconfig \
26+
&& chmod 777 / \
27+
&& chmod -R 777 /home/c-pac_user \
28+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
29+
ENV PYTHONUSERBASE=/home/c-pac_user/.local
30+
ENV PATH=$PATH:/home/c-pac_user/.local/bin \
31+
PYTHONPATH=$PYTHONPATH:$PYTHONUSERBASE/lib/python3.10/site-packages
2632

2733
# set user
34+
WORKDIR /home/c-pac_user
2835
# USER c-pac_user

variant-lite.Dockerfile

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,53 @@
1-
FROM ghcr.io/fcp-indi/c-pac:latest
1+
# Copyright (C) 2022-2023 C-PAC Developers
2+
3+
# This file is part of C-PAC.
4+
5+
# C-PAC is free software: you can redistribute it and/or modify it under
6+
# the terms of the GNU Lesser General Public License as published by the
7+
# Free Software Foundation, either version 3 of the License, or (at your
8+
# option) any later version.
9+
10+
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13+
# License for more details.
14+
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
17+
FROM ghcr.io/fcp-indi/c-pac/stage-base:lite-v1.8.6.dev1
218
LABEL org.opencontainers.image.description "Full C-PAC image without FreeSurfer"
19+
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
320
USER root
21+
22+
# install C-PAC
23+
COPY dev/circleci_data/pipe-test_ci.yml /cpac_resources/pipe-test_ci.yml
24+
COPY . /code
25+
COPY --from=ghcr.io/fcp-indi/c-pac_templates:latest /cpac_templates /cpac_templates
26+
RUN pip cache purge && pip install -e /code
27+
# set up runscript
28+
COPY dev/docker_data /code/docker_data
29+
RUN rm -Rf /code/docker_data/checksum && \
30+
mv /code/docker_data/* /code && \
31+
rm -Rf /code/docker_data && \
32+
chmod +x /code/run.py && \
33+
rm -Rf /code/run-with-freesurfer.sh
434
ENTRYPOINT ["/code/run.py"]
535

6-
# remove FreeSurfer, link libraries & clean up
7-
RUN rm -rf /usr/lib/freesurfer/ /code/run-with-freesurfer.sh /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
8-
ln -svf /usr/lib/x86_64-linux-gnu/libgsl.so.23 /usr/lib/x86_64-linux-gnu/libgsl.so.0 && ldconfig && \
9-
chmod 777 $(ls / | grep -v sys | grep -v proc)
36+
# link libraries & clean up
37+
# link libraries & clean up
38+
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/* \
39+
&& find / -type f -print0 | sort -t/ -k2 | xargs -0 rdfind -makehardlinks true \
40+
&& rm -rf results.txt \
41+
&& apt-get remove rdfind -y \
42+
&& apt-get clean \
43+
&& apt-get autoremove -y \
44+
&& ldconfig \
45+
&& chmod 777 / \
46+
&& chmod 777 $(ls / | grep -v sys | grep -v proc)
47+
ENV PYTHONUSERBASE=/home/c-pac_user/.local
48+
ENV PATH=$PATH:/home/c-pac_user/.local/bin \
49+
PYTHONPATH=$PYTHONPATH:$PYTHONUSERBASE/lib/python3.10/site-packages
1050

1151
# set user
52+
WORKDIR /home/c-pac_user
1253
# USER c-pac_user

0 commit comments

Comments
 (0)