Skip to content

Commit 9a7e028

Browse files
authored
🔒️ Add sha384sum checks for 1.8.6 installation steps (#1922)
2 parents c9528ac + 4b8c780 commit 9a7e028

22 files changed

+32393
-76
lines changed

.github/Dockerfiles/AFNI.23.0.07-bionic.Dockerfile

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,39 @@ USER root
33

44
# install AFNI
55
COPY dev/docker_data/required_afni_pkgs.txt /opt/required_afni_pkgs.txt
6-
RUN if [ -f /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0]; then \
6+
COPY dev/docker_data/checksum/AFNI.23.0.07.sha384 /tmp/AFNI.23.0.07.sha384
7+
RUN if [ -f /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 ]; then \
78
ln -svf /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/x86_64-linux-gnu/libGL.so.1; \
8-
fi && \
9-
libs_path=/usr/lib/x86_64-linux-gnu && \
10-
if [ -f $libs_path/libgsl.so.23 ]; then \
11-
ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.19 && \
12-
ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.0; \
9+
fi \
10+
&& libs_path=/usr/lib/x86_64-linux-gnu \
11+
&& if [ -f $libs_path/libgsl.so.23 ]; then \
12+
ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.19 \
13+
&& ln -svf $libs_path/libgsl.so.23 $libs_path/libgsl.so.0; \
1314
elif [ -f $libs_path/libgsl.so.23.0.0 ]; then \
14-
ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.19 && \
15-
ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.0; \
15+
ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.19 \
16+
&& ln -svf $libs_path/libgsl.so.23.0.0 $libs_path/libgsl.so.0; \
1617
elif [ -f $libs_path/libgsl.so ]; then \
1718
ln -svf $libs_path/libgsl.so $libs_path/libgsl.so.0; \
18-
fi && \
19-
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH && \
20-
export LD_LIBRARY_PATH && \
21-
apt-get update && apt-get install -y libglw1-mesa-dev && \
22-
AFNI_VERSION="23.0.07" && \
23-
curl -LOJ https://github.com/afni/afni/archive/AFNI_${AFNI_VERSION}.tar.gz && \
24-
mkdir /opt/afni && \
25-
tar -xvf afni-AFNI_${AFNI_VERSION}.tar.gz -C /opt/afni --strip-components 1 && \
26-
rm -rf afni-AFNI_${AFNI_VERSION}.tar.gz && \
27-
cd /opt/afni/src && \
28-
sed '/^INSTALLDIR =/c INSTALLDIR = /opt/afni' Makefile.linux_ubuntu_16_64 > Makefile && \
29-
make vastness && make cleanest && \
30-
cd /opt/afni && \
19+
fi \
20+
&& LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH \
21+
&& export LD_LIBRARY_PATH \
22+
&& apt-get update && apt-get install -y libglw1-mesa-dev \
23+
&& AFNI_VERSION="23.0.07" \
24+
&& curl -LOJ https://github.com/afni/afni/archive/AFNI_${AFNI_VERSION}.tar.gz \
25+
&& sha384sum --check /tmp/AFNI.23.0.07.sha384 \
26+
&& mkdir /opt/afni \
27+
&& tar -xvf afni-AFNI_${AFNI_VERSION}.tar.gz -C /opt/afni --strip-components 1 \
28+
&& rm -rf afni-AFNI_${AFNI_VERSION}.tar.gz \
29+
&& cd /opt/afni/src \
30+
&& sed '/^INSTALLDIR =/c INSTALLDIR = /opt/afni' Makefile.linux_ubuntu_16_64 > Makefile \
31+
&& make vastness && make cleanest \
32+
&& cd /opt/afni \
3133
# filter down to required packages
32-
ls > full_ls && \
33-
sed 's/linux_openmp_64\///g' /opt/required_afni_pkgs.txt | sort > required_ls && \
34-
comm -2 -3 full_ls required_ls | xargs rm -rf full_ls required_ls && \
35-
apt-get remove -y libglw1-mesa-dev && \
36-
ldconfig
34+
ls > full_ls \
35+
&& sed 's/linux_openmp_64\///g' /opt/required_afni_pkgs.txt | sort > required_ls \
36+
&& comm -2 -3 full_ls required_ls | xargs rm -rf full_ls required_ls \
37+
&& apt-get remove -y libglw1-mesa-dev \
38+
&& ldconfig
3739

3840
# set up AFNI
3941
ENV PATH=/opt/afni:$PATH
@@ -43,9 +45,9 @@ ENTRYPOINT ["/bin/bash"]
4345
# Link libraries for Singularity images
4446
RUN ldconfig
4547

46-
RUN apt-get clean && \
47-
apt-get autoremove -y && \
48-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
48+
RUN apt-get clean \
49+
&& apt-get autoremove -y \
50+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4951

5052
FROM scratch
5153
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \

.github/Dockerfiles/ANTs.2.4.3.Python3.10-bionic.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
FROM ghcr.io/fcp-indi/c-pac/ubuntu:python3.10-bionic-non-free as ANTs
22

33
USER root
4+
COPY dev/docker_data/checksum/ANTs.2.4.3.sha384 /tmp/checksum.sha384
45
RUN curl -sL https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-ubuntu-18.04-X64-gcc.zip -o /tmp/ANTs.zip \
6+
&& curl -sL https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/3133832/Oasis.zip -o /tmp/Oasis.zip \
7+
&& sha384sum --check /tmp/checksum.sha384 \
58
&& unzip /tmp/ANTs.zip -d /tmp \
69
&& mkdir /usr/lib/ants \
710
&& mv /tmp/ants-2.4.3/* /usr/lib/ants \
8-
&& curl -fsSL --retry 5 https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz \
9-
| tar -xz -C /usr/lib/ants --strip-components 1 \
1011
&& mkdir /ants_template \
11-
&& curl -sL https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/3133832/Oasis.zip -o /tmp/Oasis.zip \
1212
&& unzip /tmp/Oasis.zip -d /tmp \
1313
&& mv /tmp/MICCAI2012-Multi-Atlas-Challenge-Data /ants_template/oasis
1414

.github/Dockerfiles/FSL.6.0.6.4-Python3.10-bionic.Dockerfile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,26 @@ ENV FSLDIR=/usr/share/fsl/6.0 \
3131
TZ=America/New_York
3232

3333
# Installing and setting up FSL
34+
COPY dev/docker_data/checksum/FSL.6.0.6.4.sha384 /tmp/checksum.sha384
3435
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
3536
&& echo $TZ > /etc/timezone \
3637
&& apt-get update \
3738
&& apt-get install -y tclsh wish \
3839
&& echo "Downloading FSL ..." \
3940
&& mkdir -p /usr/share/fsl/6.0 \
40-
&& curl -sSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.4-centos6_64.tar.gz \
41-
| tar zx -C /usr/share/fsl/6.0 --strip-components=1 \
41+
&& curl -sSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.4-centos6_64.tar.gz -o /tmp/fsl.tar.gz \
42+
&& sha384sum --check /tmp/checksum.sha384 \
43+
&& tar zx -C /usr/share/fsl/6.0 --strip-components=1 \
4244
--exclude=fsl/bin/mist \
4345
--exclude=fsl/bin/possum \
4446
--exclude=fsl/data/possum \
4547
--exclude=fsl/data/mist \
46-
--exclude=fsl/data/first \
48+
--exclude=fsl/data/first -f /tmp/fsl.tar.gz \
4749
&& ln -s /usr/share/fsl/6.0 /usr/share/fsl/5.0 \
4850
&& if [ -f /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0]; then \
4951
ln -svf /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/x86_64-linux-gnu/libGL.so.1; \
5052
fi \
51-
&& ldconfig \
52-
&& curl -sL http://fcon_1000.projects.nitrc.org/indi/cpac_resources.tar.gz -o /tmp/cpac_resources.tar.gz \
53-
&& tar xfz /tmp/cpac_resources.tar.gz -C /tmp \
54-
&& cp -n /tmp/cpac_image_resources/MNI_3mm/* $FSLDIR/data/standard \
55-
&& cp -n /tmp/cpac_image_resources/MNI_4mm/* $FSLDIR/data/standard \
56-
&& cp -n /tmp/cpac_image_resources/symmetric/* $FSLDIR/data/standard \
57-
&& cp -n /tmp/cpac_image_resources/HarvardOxford-lateral-ventricles-thr25-2mm.nii.gz $FSLDIR/data/atlases/HarvardOxford \
58-
&& cp -nr /tmp/cpac_image_resources/tissuepriors/2mm $FSLDIR/data/standard/tissuepriors \
59-
&& cp -nr /tmp/cpac_image_resources/tissuepriors/3mm $FSLDIR/data/standard/tissuepriors \
60-
&& chmod -R ugo+r $FSLDIR/data/standard
53+
&& ldconfig
6154

6255
ENTRYPOINT ["/bin/bash"]
6356

.github/Dockerfiles/FSL.data.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ FROM ghcr.io/fcp-indi/c-pac/ubuntu:bionic-non-free AS FSL
33
USER root
44

55
# install CPAC resources into FSL
6+
COPY dev/docker_data/checksum/FSL.data.sha384 /tmp/checksum.sha384
67
RUN mkdir -p /fsl_data/atlases/HarvordOxford fsl_data/standard/tissuepriors \
78
&& curl -sL http://fcon_1000.projects.nitrc.org/indi/cpac_resources.tar.gz -o /tmp/cpac_resources.tar.gz \
9+
&& sha384sum --check /tmp/checksum.sha384 \
810
&& tar xfz /tmp/cpac_resources.tar.gz -C /tmp \
911
&& cp -n /tmp/cpac_image_resources/MNI_3mm/* /fsl_data/standard \
1012
&& cp -n /tmp/cpac_image_resources/MNI_4mm/* /fsl_data/standard \

.github/Dockerfiles/ICA-AROMA.0.4.4-beta-bionic.Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ FROM ghcr.io/fcp-indi/c-pac/ubuntu:bionic-non-free AS ICA-AROMA
22
USER root
33

44
# install ICA-AROMA
5-
RUN mkdir -p /opt/ICA-AROMA
6-
RUN curl -sL https://github.com/rhr-pruim/ICA-AROMA/archive/v0.4.4-beta.tar.gz | tar -xzC /opt/ICA-AROMA --strip-components 1
7-
RUN chmod +x /opt/ICA-AROMA/ICA_AROMA.py
5+
COPY dev/docker_data/checksum/ICA-AROMA.0.4.4.sha384 /tmp/checksum.sha384
6+
RUN mkdir -p /opt/ICA-AROMA \
7+
&& curl -sL https://github.com/rhr-pruim/ICA-AROMA/archive/v0.4.4-beta.tar.gz -o /tmp/ICA-AROMA.tar.gz \
8+
&& sha384sum --check /tmp/checksum.sha384 \
9+
&& tar -xzC /opt/ICA-AROMA --strip-components 1 -f /tmp/ICA-AROMA.tar.gz \
10+
&& chmod +x /opt/ICA-AROMA/ICA_AROMA.py
811
ENV PATH=/opt/ICA-AROMA:$PATH
912

1013
ENTRYPOINT ["/bin/bash"]

.github/Dockerfiles/Ubuntu.Python3.10-bionic-non-free.Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,19 @@ RUN apt-get update \
124124

125125
# install Python dependencies
126126
COPY requirements.txt /opt/requirements.txt
127-
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 \
127+
COPY dev/docker_data/get-pip_23.0.1.py /tmp/get-pip.py
128+
COPY dev/docker_data/github_git-lfs.list /etc/apt/sources.list.d/github_git-lfs.list
129+
COPY dev/docker_data/checksum/Python3.10-bionic.sha384 /tmp/checksum.sha384
130+
RUN python3.10 /tmp/get-pip.py \
128131
&& pip install --upgrade pip setuptools \
129132
&& pip install -r /opt/requirements.txt \
130133
# install git-lfs
131-
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
134+
&& curl -fsSL https://packagecloud.io/github/git-lfs/gpgkey | gpg --dearmor > /etc/apt/trusted.gpg.d/github_git-lfs-archive-keyring.gpg \
135+
&& sha384sum --check /tmp/checksum.sha384 \
136+
&& apt-get update \
132137
&& apt-get install -y --no-install-recommends git-lfs \
133-
&& git lfs install
138+
&& git lfs install \
139+
&& rm /tmp/get-pip.py /tmp/checksum.sha384
134140

135141
COPY --from=c-pac_templates /cpac_templates /cpac_templates
136142
COPY --from=dcan-hcp /opt/dcan-tools/pipeline/global /opt/dcan-tools/pipeline/global
@@ -148,5 +154,5 @@ RUN ldconfig && \
148154
apt-get autoremove -y && \
149155
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
150156

151-
# # set user
157+
# Set user
152158
USER c-pac_user

.github/Dockerfiles/base-lite.Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
1717
FROM ghcr.io/fcp-indi/c-pac/afni:23.0.07-bionic as AFNI
1818
FROM ghcr.io/fcp-indi/c-pac/ants:2.4.3.python3.10-bionic as ANTs
19+
FROM ghcr.io/fcp-indi/c-pac/c3d:1.0.0-bionic as c3d
1920
FROM ghcr.io/fcp-indi/c-pac/connectome-workbench:1.5.0.neurodebian-bionic as connectome-workbench
2021
FROM ghcr.io/fcp-indi/c-pac/fsl:6.0.6.4-python3.10-bionic as FSL
2122
FROM ghcr.io/fcp-indi/c-pac/ica-aroma:0.4.4-beta-bionic as ICA-AROMA
@@ -43,14 +44,12 @@ ENV POSSUMDIR=${FSLDIR}/6.0 \
4344
PATH=${FSLDIR}/bin:$PATH
4445
COPY --from=FSL /usr/bin/tclsh /usr/bin/tclsh
4546
COPY --from=FSL /usr/bin/wish /usr/bin/wish
46-
COPY --from=FSL /usr/share/fsl /usr/share/fsl
47+
COPY --from=FSL /usr/share/fsl/ /usr/share/fsl/
4748
COPY --from=FSL /lib/x86_64-linux-gnu/lib*so* /lib/x86_64-linux-gnu/
4849

4950
# Installing and setting up c3d
50-
RUN mkdir -p /opt/c3d && \
51-
curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" \
52-
| tar -xzC /opt/c3d --strip-components 1
53-
ENV C3DPATH /opt/c3d
51+
COPY --from=c3d /opt/c3d/ opt/c3d/
52+
ENV C3DPATH /opt/c3d/
5453
ENV PATH $C3DPATH/bin:$PATH
5554

5655
# Installing AFNI

.github/Dockerfiles/c3d.1.0.0-bionic.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ FROM ghcr.io/fcp-indi/c-pac/ubuntu:bionic-non-free as c3d
22
USER root
33

44
# Installing and setting up c3d
5+
COPY dev/docker_data/checksum/c3d.1.0.0.sha384 /tmp/checksum.sha384
56
RUN mkdir -p /opt/c3d && \
6-
curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" \
7-
| tar -xzC /opt/c3d --strip-components 1
7+
curl -sSL "http://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz" -o /tmp/c3d.tar.gz \
8+
&& sha384sum --check /tmp/checksum.sha384 \
9+
&& tar -xzC /opt/c3d --strip-components 1 -f /tmp/c3d.tar.gz
810
ENV C3DPATH /opt/c3d/
911
ENV PATH $C3DPATH/bin:$PATH
1012

.github/Dockerfiles/connectome-workbench.1.5.0.neurodebian-bionic.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ FROM ghcr.io/fcp-indi/c-pac/ubuntu:python3.10-bionic-non-free as base
22

33
USER root
44

5+
COPY dev/docker_data/checksum/connectome-workbench.1.5.0.sha384 /tmp/checksum.sha384
56
RUN curl -sSL "https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip" -o /opt/workbench.zip \
7+
&& sha384sum --check /tmp/checksum.sha384 \
68
&& unzip /opt/workbench.zip -d /opt \
79
&& rm -rf /opt/workbench.zip
810
ENV PATH $PATH:/opt/workbench/bin_linux64

.github/Dockerfiles/msm.2.0-bionic.Dockerfile

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@ FROM neurodebian:bionic-non-free as MSM
33

44
ARG DEBIAN_FRONTEND=noninteractive
55

6-
RUN apt-get update && \
7-
apt-get install -y --no-install-recommends \
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends \
88
curl \
9-
libexpat1-dev && \
10-
apt-get autoremove -y && \
11-
apt-get autoclean -y
9+
libexpat1-dev \
10+
&& apt-get autoremove -y \
11+
&& apt-get autoclean -y
1212

1313
#---------------------
1414
# Install MSM Binaries
1515
#---------------------
16-
RUN mkdir /opt/msm
17-
RUN curl -ksSL --retry 5 https://www.doc.ic.ac.uk/~ecr05/MSM_HOCR_v2/MSM_HOCR_v2-download.tgz | tar zx -C /opt
18-
RUN mv /opt/homes/ecr05/MSM_HOCR_v2/* /opt/msm/
19-
RUN rm -rf /opt/homes /opt/msm/MacOSX /opt/msm/Centos
20-
RUN chmod +x /opt/msm/Ubuntu/*
21-
ENV MSMBINDIR=/opt/msm/Ubuntu \
22-
PATH=$PATH:/opt/msm/Ubuntu
16+
COPY dev/docker_data/checksum/msm.2.0.sha384 /tmp/checksum.sha384
17+
RUN mkdir /opt/msm \
18+
&& curl -ksSL --retry 5 https://www.doc.ic.ac.uk/~ecr05/MSM_HOCR_v2/MSM_HOCR_v2-download.tgz -o msm.tgz \
19+
&& sha384sum --check /tmp/checksum.sha384 \
20+
&& tar zx -C /opt -f msm.tgz \
21+
&& mv /opt/homes/ecr05/MSM_HOCR_v2/* /opt/msm/ \
22+
&& rm -rf /opt/homes /opt/msm/MacOSX /opt/msm/Centos \
23+
&& chmod +x /opt/msm/Ubuntu/* \
24+
&& MSMBINDIR=/opt/msm/Ubuntu \
25+
PATH=$PATH:/opt/msm/Ubuntu
2326

2427
ENTRYPOINT ["/bin/bash"]
2528

2629
# Link libraries for Singularity images
27-
RUN ldconfig
28-
29-
RUN apt-get clean && \
30-
apt-get autoremove -y && \
31-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
30+
RUN ldconfig \
31+
&& apt-get clean \
32+
&& apt-get autoremove -y \
33+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3234

3335
FROM scratch
3436
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \

0 commit comments

Comments
 (0)